pub struct Work { /* private fields */ }Expand description
A work item that can be submitted to a Workqueue.
Implementations§
Source§impl Work
impl Work
Sourcepub fn new(handler: ove_work_fn) -> Result<Self>
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.
Sourcepub fn submit(&self, wq: &Workqueue) -> Result<()>
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.
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more