pub struct Time(/* private fields */);Expand description
Abstraction of time.
On Server::new(), the service is at time 0. Every
Time returned as Output::Timeout, is in the
future from that current time.
You drive the time forward in the service by passing Input::Timeout.
Every such drives time forward.
Implementations§
Source§impl Time
impl Time
Sourcepub fn from_millis(t: u64) -> Self
pub fn from_millis(t: u64) -> Self
Create a new time from a millisecond offset from an imaginary time 0.
Sourcepub fn millis_until(&self, other: Time) -> u64
pub fn millis_until(&self, other: Time) -> u64
Check how many milliseconds there is from this Time to some other Time.
If other is in the past, this returns 0.
Trait Implementations§
Source§impl Ord for Time
impl Ord for Time
Source§impl PartialOrd for Time
impl PartialOrd for Time
impl Copy for Time
impl Eq for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more