[][src]Struct rttrust::timer::TimerStatic

pub struct TimerStatic { /* fields omitted */ }

Implementations

impl TimerStatic[src]

pub const fn new() -> Self[src]

pub fn init<P>(
    &'static self,
    name: &str,
    entry: TimerEntry<P>,
    parameter: P,
    time: u32,
    flag: TimerFlags
) where
    P: CallbackParameter
[src]

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

pub fn detach(&'static self) -> Result<()>[src]

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[src]

Methods from Deref<Target = Timer>

pub fn start(&self) -> Result<()>[src]

This function will start the timer

@return the operation status, RT_EOK on OK, -RT_ERROR on error

pub fn stop(&self) -> Result<()>[src]

This function will stop the timer

@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.

Trait Implementations

impl Deref for TimerStatic[src]

type Target = Timer

The resulting type after dereferencing.

impl Send for TimerStatic[src]

impl Sync for TimerStatic[src]

Will be removed once find a way to static init

Auto Trait Implementations

impl !Unpin for TimerStatic

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.