pub struct Timer { /* private fields */ }Implementations§
Source§impl Timer
impl Timer
pub fn init(clock_id: u32) -> impl PinInit<Self, Infallible>
Sourcepub unsafe fn set_deadline(
self: Pin<&mut Self>,
deadline: &Deadline,
callback: Callback,
arg: *mut c_void,
)
pub unsafe fn set_deadline( self: Pin<&mut Self>, deadline: &Deadline, callback: Callback, arg: *mut c_void, )
Schedules the timer to fire at the specified deadline.
§Safety
The caller must ensure that:
callbackis a valid FFI callback that does not cause undefined behavior when executed.argis either a valid pointer or a null pointer, and is safe to pass tocallback.
Sourcepub unsafe fn set_oneshot(
self: Pin<&mut Self>,
deadline: i64,
callback: Callback,
arg: *mut c_void,
)
pub unsafe fn set_oneshot( self: Pin<&mut Self>, deadline: i64, callback: Callback, arg: *mut c_void, )
Schedules the timer to fire once at the specified deadline (in nanoseconds).
§Safety
Same as Self::set_deadline.
pub fn cancel(self: Pin<&mut Self>) -> bool
Trait Implementations§
Source§impl PinnedDrop for Timer
impl PinnedDrop for Timer
impl Send for Timer
Auto Trait Implementations§
impl !Freeze for Timer
impl !RefUnwindSafe for Timer
impl !Sync for Timer
impl UnsafeUnpin for Timer
impl UnwindSafe for Timer
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read moreSource§fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
First initializes the value using
self then calls the function f with the initialized
value. Read more