[−][src]Struct rttrust::timer::Timer
All methods use immutable self since the safety is guaranteed by rt-thread internal
TODO: timer control
Implementations
impl Timer
[src]
pub fn new(timer: &mut rt_timer) -> &Timer
[src]
pub fn create<P>(
name: &str,
entry: TimerEntry<P>,
parameter: CallbackParameter,
time: u32,
flag: TimerFlags
) -> Result<Timer> where
P: Into<CallbackParameter>,
[src]
name: &str,
entry: TimerEntry<P>,
parameter: CallbackParameter,
time: u32,
flag: TimerFlags
) -> Result<Timer> where
P: Into<CallbackParameter>,
This function will create a timer
@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
@return the created timer object
pub fn create_closure<F>(
name: &str,
entry: F,
time: u32,
flag: TimerFlags
) -> Result<Timer> where
F: FnOnce(),
F: Send + 'static,
[src]
name: &str,
entry: F,
time: u32,
flag: TimerFlags
) -> Result<Timer> where
F: FnOnce(),
F: Send + 'static,
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 delete(self) -> Result<()>
[src]
This function will delete a timer and release timer memory
@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 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 Clone for Timer
[src]
fn clone(&self) -> Timer
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Timer
[src]
impl Object for Timer
[src]
fn get_ptr(&self) -> NonNull<rt_object>
[src]
fn is_systemobject(&self) -> bool
[src]
fn get_type(&self) -> u8
[src]
fn get_name<'a>(&'a self) -> RtNameRef<'a>
[src]
impl Send for Timer
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,