pub struct Model {
pub timeout: Duration,
pub interval: Duration,
/* private fields */
}Expand description
Model of the timer component.
Fields§
§timeout: DurationHow long until the timer expires.
interval: DurationHow long to wait before every tick. Defaults to 1 second.
Implementations§
Source§impl Model
impl Model
Sourcepub fn id(&self) -> i32
pub fn id(&self) -> i32
ID returns the model’s identifier. This can be used to determine if messages belong to this timer instance when there are multiple timers.
Sourcepub fn running(&self) -> bool
pub fn running(&self) -> bool
Running returns whether or not the timer is running. If the timer has timed out this will always return false.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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