Struct kernel::workqueue::BoxedQueue
source · [−]pub struct BoxedQueue { /* private fields */ }
Expand description
A boxed owned workqueue.
Invariants
ptr
is owned by this instance of BoxedQueue
, so it’s always valid.
Methods from Deref<Target = Queue>
sourcepub fn enqueue<T: WorkAdapter<Target = T>>(&self, w: Arc<T>) -> bool
pub fn enqueue<T: WorkAdapter<Target = T>>(&self, w: Arc<T>) -> bool
Enqueues a work item.
Returns true
if the work item was successfully enqueue; returns false
if it had already
been (and continued to be) enqueued.
sourcepub fn enqueue_adapter<A: WorkAdapter + ?Sized>(&self, w: Arc<A::Target>) -> bool
pub fn enqueue_adapter<A: WorkAdapter + ?Sized>(&self, w: Arc<A::Target>) -> bool
Enqueues a work item with an explicit adapter.
Returns true
if the work item was successfully enqueue; returns false
if it had already
been (and continued to be) enqueued.
sourcepub fn try_spawn<T: 'static + Send + Fn()>(
&self,
key: &'static LockClassKey,
func: T
) -> Result
pub fn try_spawn<T: 'static + Send + Fn()>(
&self,
key: &'static LockClassKey,
func: T
) -> Result
Tries to spawn the given function or closure as a work item.
Users are encouraged to use spawn_work_item
as it automatically defines the lock class
key to be used.
Trait Implementations
sourceimpl Deref for BoxedQueue
impl Deref for BoxedQueue
Auto Trait Implementations
impl !RefUnwindSafe for BoxedQueue
impl !Send for BoxedQueue
impl !Sync for BoxedQueue
impl Unpin for BoxedQueue
impl !UnwindSafe for BoxedQueue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more