pub struct Timer(/* private fields */);Implementations§
source§impl Timer
impl Timer
sourcepub fn new<F>(
clk: Clock,
duration: Duration,
f: F,
name: String,
) -> AnyResult<Self>
pub fn new<F>( clk: Clock, duration: Duration, f: F, name: String, ) -> AnyResult<Self>
Creates a new Timer instance on the specified Clock.
§Arguments
clk: The clock instance which the timer is being created on.duration: Specifies the expiration duration of the timer.f: Callback function invoked after the timer expires.name: Name of the timer, used for logging purposes.
§Returns
Returns Ok(Timer) if successful, or an error if creation fails.
Auto Trait Implementations§
impl Freeze for Timer
impl !RefUnwindSafe for Timer
impl Send for Timer
impl !Sync for Timer
impl Unpin for Timer
impl !UnwindSafe for Timer
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