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.
Sourcepub fn enqueue_delayed<W, const ID: u64>(
&self,
w: W,
delay: Jiffies,
) -> W::EnqueueOutputwhere
W: RawDelayedWorkItem<ID> + Send + 'static,
pub fn enqueue_delayed<W, const ID: u64>(
&self,
w: W,
delay: Jiffies,
) -> W::EnqueueOutputwhere
W: RawDelayedWorkItem<ID> + Send + 'static,
Enqueues a delayed 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§
impl !Freeze for Queue
impl !RefUnwindSafe for Queue
impl !Unpin for Queue
impl !UnsafeUnpin for Queue
impl Forget for Queue
impl UnwindSafe for Queue
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
Source§fn into_safe_cast(self) -> T
fn into_safe_cast(self) -> T
Convert
self into a T. This operation is guaranteed to be lossless.Source§impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
Source§fn into_safe_cast_arch(self) -> T
fn into_safe_cast_arch(self) -> T
Convert
self into a T. This operation is guaranteed to be lossless.