#[repr(transparent)]pub struct Queue(/* private fields */);
Expand description
A kernel work queue.
Wraps the kernel’s C struct workqueue_struct
.
It allows work items to be queued to run on thread pools managed by the kernel. Several are
always available, for example, system
, system_highpri
, system_long
, etc.
Implementations§
source§impl Queue
impl Queue
sourcepub unsafe fn from_raw<'a>(ptr: *const workqueue_struct) -> &'a Queue
pub unsafe fn from_raw<'a>(ptr: *const workqueue_struct) -> &'a Queue
Use the provided struct workqueue_struct
with Rust.
Safety
The caller must ensure that the provided raw pointer is not dangling, that it points at a valid workqueue, and that it remains valid until the end of ’a.
sourcepub fn enqueue<W, const ID: u64>(&self, w: W) -> W::EnqueueOutputwhere
W: RawWorkItem<ID> + Send + 'static,
pub fn enqueue<W, const ID: u64>(&self, w: W) -> W::EnqueueOutputwhere W: RawWorkItem<ID> + Send + 'static,
Enqueues a work item.
This may fail if the work item is already enqueued in a workqueue.
The work item will be submitted using WORK_CPU_UNBOUND
.
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