Work

Struct Work 

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

A work item that can be submitted to a Workqueue.

Implementations§

Source§

impl Work

Source

pub fn new(handler: ove_work_fn) -> Result<Self>

Create a work item via heap allocation (only in heap mode).

The handler receives the raw ove_work_t handle (the C API does not provide a user_data parameter for work handlers).

§Errors

Returns Error::NoMemory if heap allocation fails.

Source

pub fn submit(&self, wq: &Workqueue) -> Result<()>

Submit this work item to wq for immediate execution.

§Errors

Returns an error if the workqueue is shutting down or the item is already pending.

Source

pub fn submit_delayed(&self, wq: &Workqueue, delay_ms: u32) -> Result<()>

Submit this work item to wq for execution after delay_ms milliseconds.

§Errors

Returns an error if the workqueue is shutting down or the item is already pending.

Source

pub fn cancel(&self) -> Result<()>

Cancel this work item if it is pending or delayed.

Has no effect if the item is not currently queued.

§Errors

Returns an error if the underlying RTOS call fails.

Trait Implementations§

Source§

impl Drop for Work

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Work

Source§

impl Sync for Work

Auto Trait Implementations§

§

impl Freeze for Work

§

impl RefUnwindSafe for Work

§

impl Unpin for Work

§

impl UnwindSafe for Work

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.