pub struct Timer {
pub(crate) handle: SafeDescriptor,
pub(crate) interval: Option<Duration>,
}
Fields§
§handle: SafeDescriptor
§interval: Option<Duration>
Implementations§
Trait Implementations§
source§impl AsRawDescriptor for Timer
impl AsRawDescriptor for Timer
source§fn as_raw_descriptor(&self) -> RawDescriptor
fn as_raw_descriptor(&self) -> RawDescriptor
Returns the underlying raw descriptor. Read more
source§impl FromRawDescriptor for Timer
impl FromRawDescriptor for Timer
source§unsafe fn from_raw_descriptor(handle: RawDescriptor) -> Self
unsafe fn from_raw_descriptor(handle: RawDescriptor) -> Self
Safety Read more
source§impl IntoRawDescriptor for Timer
impl IntoRawDescriptor for Timer
fn into_raw_descriptor(self) -> RawDescriptor
source§impl TimerTrait for Timer
impl TimerTrait for Timer
source§fn reset_oneshot(&mut self, dur: Duration) -> Result<()>
fn reset_oneshot(&mut self, dur: Duration) -> Result<()>
Sets the timer to expire after
dur
without repeating. Cancels any existing timer.source§fn reset_repeating(&mut self, dur: Duration) -> Result<()>
fn reset_repeating(&mut self, dur: Duration) -> Result<()>
Sets the timer to fire repeatedly at
dur
intervals. Cancels any existing timer.source§fn mark_waited(&mut self) -> Result<bool>
fn mark_waited(&mut self) -> Result<bool>
After a timer is triggered from an EventContext, mark the timer as having been waited for.
If a timer is not marked waited, it will immediately trigger the event context again. This
does not need to be called after calling Timer::wait. Read more
source§fn resolution(&self) -> Result<Duration>
fn resolution(&self) -> Result<Duration>
Returns the resolution of timers on the host.
Auto Trait Implementations§
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> AsRawDescriptors for Twhere
T: AsRawDescriptor,
impl<T> AsRawDescriptors for Twhere
T: AsRawDescriptor,
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