pub struct WorkQueue { /* private fields */ }
Expand description
A running work queue thread.
§Panic
Allowing a work queue to drop will result in a panic. There are two ways to handle this, depending on whether the WorkQueue is in a Box, or an Arc:
// Leak a work queue in an Arc.
let wq = Arc::new(WorkQueueBuilder::new().start(...));
// If the Arc is used after this:
let _ = Arc::into_raw(wq.clone());
// If the Arc is no longer needed:
let _ = Arc::into_raw(wq);
// Leak a work queue in a Box.
let wq = Box::new(WorkQueueBuilder::new().start(...));
let _ = Box::leak(wq);
Trait Implementations§
impl Send for WorkQueue
Work queues can be referenced from multiple threads, and thus are Send and Sync.
impl Sync for WorkQueue
Auto Trait Implementations§
impl Freeze for WorkQueue
impl !RefUnwindSafe for WorkQueue
impl Unpin for WorkQueue
impl UnwindSafe for WorkQueue
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