pub struct Alarm<'d> { /* private fields */ }Expand description
Single-shot alarm functionality for OSTIMER
Implementations§
Source§impl<'d> Alarm<'d>
impl<'d> Alarm<'d>
Sourcepub fn with_callback(self, callback: fn()) -> Self
pub fn with_callback(self, callback: fn()) -> Self
Set a callback that will be executed when the alarm expires Note: Due to interrupt handler constraints, callbacks must be static function pointers
Sourcepub fn with_flag(self, flag: &'d AtomicBool) -> Self
pub fn with_flag(self, flag: &'d AtomicBool) -> Self
Set a flag that will be set to true when the alarm expires
Trait Implementations§
Auto Trait Implementations§
impl<'d> !Freeze for Alarm<'d>
impl<'d> RefUnwindSafe for Alarm<'d>
impl<'d> Send for Alarm<'d>
impl<'d> Sync for Alarm<'d>
impl<'d> Unpin for Alarm<'d>
impl<'d> !UnwindSafe for Alarm<'d>
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