pub struct TimeGate { /* private fields */ }Expand description
Generic readiness gate represented by an optional ready-at timestamp.
Nonemeans ready immediately.Some(ts)means ready whennow >= ts.
Implementations§
Source§impl TimeGate
impl TimeGate
pub const fn ready_now() -> Self
pub const fn from_ready_at(ready_at_ns: TimestampNs) -> Self
pub const fn schedule_from(now_ns: TimestampNs, delay_ns: TimestampNs) -> Self
pub const fn ready_at_ns(self) -> Option<TimestampNs>
pub fn is_ready(self, now_ns: TimestampNs) -> bool
pub fn remaining(self, now_ns: TimestampNs) -> TimestampNs
Trait Implementations§
impl Copy for TimeGate
impl Eq for TimeGate
impl StructuralPartialEq for TimeGate
Auto Trait Implementations§
impl Freeze for TimeGate
impl RefUnwindSafe for TimeGate
impl Send for TimeGate
impl Sync for TimeGate
impl Unpin for TimeGate
impl UnwindSafe for TimeGate
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