Struct crs_bind::rtos::Task[][src]

pub struct Task(_);

Represents a FreeRTOS task.

Implementations

impl Task[src]

pub const DEFAULT_PRIORITY: u32[src]

The default priority for new tasks.

pub const DEFAULT_STACK_DEPTH: u16[src]

The default stack depth for new tasks.

pub fn delay(dur: Duration)[src]

Delays the current task by the specified duration.

pub fn current() -> Task[src]

Gets the current task.

pub fn find_by_name(name: &str) -> Result<Task, Error>[src]

Finds a task by its name.

pub fn spawn<F>(f: F) -> Result<Task, Error> where
    F: FnOnce() + Send + 'static, 
[src]

Spawns a new task with no name and the default priority and stack depth.

pub fn spawn_ext<F>(
    name: &str,
    priority: u32,
    stack_depth: u16,
    f: F
) -> Result<Task, Error> where
    F: FnOnce() + Send + 'static, 
[src]

Spawns a new task with the specified name, priority and stack depth.

pub fn spawn_raw(
    name: &str,
    priority: u32,
    stack_depth: u16,
    f: unsafe extern "C" fn(arg1: *mut c_void),
    arg: *mut c_void
) -> Result<Task, Error>
[src]

Spawns a new task from a C function pointer and an arbitrary data pointer.

pub fn name(&self) -> String[src]

Gets the name of the task.

pub fn priority(&self) -> u32[src]

Gets the priority of the task.

pub fn state(&self) -> TaskState[src]

Gets the state of the task.

pub unsafe fn delete(&self)[src]

Unsafely deletes the task.

Safety

This is unsafe because it does not guarantee that the task’s code safely unwinds (i.e., that destructors are called, memory is freed and other resources are released).

Trait Implementations

impl Clone for Task[src]

impl Debug for Task[src]

impl Eq for Task[src]

impl Ord for Task[src]

impl PartialEq<Task> for Task[src]

impl PartialOrd<Task> for Task[src]

impl Send for Task[src]

impl StructuralEq for Task[src]

impl StructuralPartialEq for Task[src]

impl Sync for Task[src]

Auto Trait Implementations

impl Unpin for Task

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.