pub struct TimerStatic { /* private fields */ }
Implementations§
Source§impl TimerStatic
impl TimerStatic
pub const fn new() -> Self
Sourcepub fn init<P>(
&'static self,
name: &str,
entry: TimerEntry<P>,
parameter: P,
time: u32,
flag: TimerFlags,
)where
P: CallbackParameter,
pub fn init<P>(
&'static self,
name: &str,
entry: TimerEntry<P>,
parameter: P,
time: u32,
flag: TimerFlags,
)where
P: CallbackParameter,
This function will initialize a timer, normally this function is used to initialize a static timer object.
@param name the name of timer @param timeout the timeout function @param parameter the parameter of timeout function @param time the tick of timer @param flag the flag of timer
Sourcepub fn detach(&'static self) -> Result<()>
pub fn detach(&'static self) -> Result<()>
This function will detach a timer from timer management.
@param timer the static timer object
@return the operation status, RT_EOK on OK; RT_ERROR on error
§Wanring:
Rust timer has no cleanup function and is not able to unwind. Directly stopping a Rust timer may lead to resoucre leak.
pub fn get_timer(&'static self) -> Timer
Methods from Deref<Target = Timer>§
Trait Implementations§
Source§impl Deref for TimerStatic
impl Deref for TimerStatic
impl Send for TimerStatic
impl Sync for TimerStatic
Will be removed once find a way to static init
Auto Trait Implementations§
impl !Freeze for TimerStatic
impl !RefUnwindSafe for TimerStatic
impl !Unpin for TimerStatic
impl UnwindSafe for TimerStatic
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