Struct pawawwewism::Worker
source · pub struct Worker<I: Send + 'static> { /* private fields */ }
Expand description
A handle to a worker thread that processes messages of type I
.
This type enforces structured concurrency: When it’s dropped, the thread will be signaled to
exit and the thread will be joined. If the thread has panicked, the panic will be forwarded
to the thread dropping the Worker
.
Implementations§
source§impl Worker<()>
impl Worker<()>
sourcepub fn builder() -> WorkerBuilder
pub fn builder() -> WorkerBuilder
Returns a builder that can be used to configure and spawn a Worker
.
Trait Implementations§
Auto Trait Implementations§
impl<I> !RefUnwindSafe for Worker<I>
impl<I> Send for Worker<I>
impl<I> Sync for Worker<I>
impl<I> Unpin for Worker<I>
impl<I> !UnwindSafe for Worker<I>
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