pub trait Make<Clock>: Sizedwhere
Clock: Time,{
// Provided methods
fn now(increment: &Base) -> Option<Result<TimeExtent, TryFromIntError>> { ... }
fn now_after(
increment: &Base,
add_time: &Duration,
) -> Option<Result<TimeExtent, TryFromIntError>> { ... }
fn now_before(
increment: &Base,
sub_time: &Duration,
) -> Option<Result<TimeExtent, TryFromIntError>> { ... }
}Expand description
A TimeExtent maker. It’s a clock base on time extents.
It gives you the time in time extents.
Provided Methods§
sourcefn now(increment: &Base) -> Option<Result<TimeExtent, TryFromIntError>>
fn now(increment: &Base) -> Option<Result<TimeExtent, TryFromIntError>>
It gives you the current time extent (with a certain increment) for
the current time. It gets the current timestamp front the Clock.
For example:
- If the base increment is
1second, it will return a time extent whose duration is1 secondand whose multiplier is the the number of seconds since the Unix Epoch (time extent). - If the base increment is
1minute, it will return a time extent whose duration is60 secondsand whose multiplier is the number of minutes since the Unix Epoch (time extent).
sourcefn now_after(
increment: &Base,
add_time: &Duration,
) -> Option<Result<TimeExtent, TryFromIntError>>
fn now_after( increment: &Base, add_time: &Duration, ) -> Option<Result<TimeExtent, TryFromIntError>>
Same as now, but it
will add an extra duration to the current time before calculating the
time extent. It gives you a time extent for a time in the future.
sourcefn now_before(
increment: &Base,
sub_time: &Duration,
) -> Option<Result<TimeExtent, TryFromIntError>>
fn now_before( increment: &Base, sub_time: &Duration, ) -> Option<Result<TimeExtent, TryFromIntError>>
Same as now, but it
will subtract a duration to the current time before calculating the
time extent. It gives you a time extent for a time in the past.
Object Safety§
This trait is not object safe.