TryAddDurations
Combines mixed integer duration representations using the wider RightRep count.
Module std.time
import std.time;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
fn
pub const fn TryAddDurations<LeftRep, RightRep, const LeftNumerator: u64, const LeftDenominator: u64,
const RightNumerator: u64, const RightDenominator: u64>(
Left: readonly Duration<LeftRep, LeftNumerator, LeftDenominator>&,
Right: readonly Duration<RightRep, RightNumerator, RightDenominator>&) -> Result<Duration<RightRep, CommonDurationNumerator(LeftNumerator, LeftDenominator, RightNumerator, RightDenominator), CommonDurationDenominator(LeftNumerator, LeftDenominator, RightNumerator, RightDenominator)>, DurationError>
where LeftRep: Data, DurationCount where RightRep: Data, DurationCount, WideningNumeric<LeftRep>Combines mixed integer duration representations using the wider RightRep count. LeftRep: Exact left numeric count representation. RightRep: Exact right numeric count representation. LeftNumerator: Positive left unit seconds numerator. LeftDenominator: Positive left unit seconds denominator. RightNumerator: Positive right unit seconds numerator. RightDenominator: Positive right unit seconds denominator. Left: Finite left duration borrowed only during common-period combination. Right: Finite right duration borrowed only during common-period combination. Return: Selected wider-representation common-unit result or checked range error.
fn
pub const fn operator +<LeftRep, RightRep, const LeftNumerator: u64, const LeftDenominator: u64,
const RightNumerator: u64, const RightDenominator: u64>(
Left: readonly Duration<LeftRep, LeftNumerator, LeftDenominator>&,
Right: readonly Duration<RightRep, RightNumerator, RightDenominator>&) -> Duration<RightRep, CommonDurationNumerator(LeftNumerator, LeftDenominator, RightNumerator, RightDenominator), CommonDurationDenominator(LeftNumerator, LeftDenominator, RightNumerator, RightDenominator)>
where LeftRep: Data, DurationCount where RightRep: Data, DurationCount, WideningNumeric<LeftRep>Combines mixed integer duration representations using the wider RightRep count. LeftRep: Exact left numeric count representation. RightRep: Exact right numeric count representation. LeftNumerator: Positive left unit seconds numerator. LeftDenominator: Positive left unit seconds denominator. RightNumerator: Positive right unit seconds numerator. RightDenominator: Positive right unit seconds denominator. Left: Finite left duration borrowed only during common-period combination. Right: Finite right duration borrowed only during common-period combination. Return: Selected wider-representation common-unit result with checked failure trapping, never Endless.
fn
pub const fn TryAddDurations<LeftRep, RightRep, const LeftNumerator: u64, const LeftDenominator: u64,
const RightNumerator: u64, const RightDenominator: u64>(
Left: readonly Duration<LeftRep, LeftNumerator, LeftDenominator>&,
Right: readonly Duration<RightRep, RightNumerator, RightDenominator>&) -> Result<Duration<LeftRep, CommonDurationNumerator(LeftNumerator, LeftDenominator, RightNumerator, RightDenominator), CommonDurationDenominator(LeftNumerator, LeftDenominator, RightNumerator, RightDenominator)>, DurationError>
where LeftRep: Data, DurationCount, WideningNumeric<RightRep> where RightRep: Data, DurationCountCombines mixed integer duration representations using the wider LeftRep count. LeftRep: Exact left numeric count representation. RightRep: Exact right numeric count representation. LeftNumerator: Positive left unit seconds numerator. LeftDenominator: Positive left unit seconds denominator. RightNumerator: Positive right unit seconds numerator. RightDenominator: Positive right unit seconds denominator. Left: Finite left duration borrowed only during common-period combination. Right: Finite right duration borrowed only during common-period combination. Return: Selected wider-representation common-unit result or checked range error.
fn
pub const fn operator +<LeftRep, RightRep, const LeftNumerator: u64, const LeftDenominator: u64,
const RightNumerator: u64, const RightDenominator: u64>(
Left: readonly Duration<LeftRep, LeftNumerator, LeftDenominator>&,
Right: readonly Duration<RightRep, RightNumerator, RightDenominator>&) -> Duration<LeftRep, CommonDurationNumerator(LeftNumerator, LeftDenominator, RightNumerator, RightDenominator), CommonDurationDenominator(LeftNumerator, LeftDenominator, RightNumerator, RightDenominator)>
where LeftRep: Data, DurationCount, WideningNumeric<RightRep> where RightRep: Data, DurationCountCombines mixed integer duration representations using the wider LeftRep count. LeftRep: Exact left numeric count representation. RightRep: Exact right numeric count representation. LeftNumerator: Positive left unit seconds numerator. LeftDenominator: Positive left unit seconds denominator. RightNumerator: Positive right unit seconds numerator. RightDenominator: Positive right unit seconds denominator. Left: Finite left duration borrowed only during common-period combination. Right: Finite right duration borrowed only during common-period combination. Return: Selected wider-representation common-unit result with checked failure trapping, never Endless.