pub struct NamedTimer;Expand description
A timer with an associated name.
This timer is intended to be used in conjunction with the fake-clock library. Under normal
execution, the timer behaves the same as a regular fuchsia_async::Timer. When run in an
integration test with the fake-clock library linked in, the creation of the timer and
the expiration of the timer are reported to the fake-clock service. The integration test may
register interest in these events to stop time when they occur.
Implementations§
Source§impl NamedTimer
impl NamedTimer
Sourcepub fn new(id: &DeadlineId<'_>, duration: MonotonicDuration) -> Timer
pub fn new(id: &DeadlineId<'_>, duration: MonotonicDuration) -> Timer
Create a new NamedTimer that will expire duration in the future.
In an integration test, the SET event is reported immediately when this method is called,
and EXPIRED is reported after duration elapses. Note EXPIRED is still reported even
if the timer is dropped before duration elapses.
Auto Trait Implementations§
impl Freeze for NamedTimer
impl RefUnwindSafe for NamedTimer
impl Send for NamedTimer
impl Sync for NamedTimer
impl Unpin for NamedTimer
impl UnwindSafe for NamedTimer
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