zephyr::work

Struct WorkQueueBuilder

Source
pub struct WorkQueueBuilder { /* private fields */ }
Expand description

A builder for work queues themselves.

A work queue is a Zephyr thread that instead of directly running a piece of code, manages a work queue. Various types of Work can be submitted to these queues, along with various types of triggering conditions.

Implementations§

Source§

impl WorkQueueBuilder

Source

pub fn new() -> Self

Construct a new WorkQueueBuilder with default values.

Source

pub fn set_name(&mut self, name: &'static CStr) -> &mut Self

Set the name for the WorkQueue thread.

This name shows up in debuggers and some analysis tools.

Source

pub fn set_no_yield(&mut self, value: bool) -> &mut Self

Set the “no yield” flag for the created worker.

If this is not set, the work queue will call k_yield between each enqueued work item. For non-preemptible threads, this will allow other threads to run. For preemptible threads, this will allow other threads at the same priority to run.

This method has a negative in the name, which goes against typical conventions. This is done to match the field in the Zephyr config.

Source

pub fn set_essential(&mut self, value: bool) -> &mut Self

Set the “essential” flag for the created worker.

This sets the essential flag on the running thread. The system considers the termination of an essential thread to be a fatal error.

Source

pub fn set_priority(&mut self, value: c_int) -> &mut Self

Set the priority for the worker thread.

See the Zephyr docs for the meaning of priority.

Source

pub fn start(&self, stack: ThreadStack) -> WorkQueue

Start the given work queue thread.

TODO: Implement a ‘start’ that works from a static work queue.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.