pub struct SupervisorBuilder { /* private fields */ }
Expand description
Build a supervisor.
Implementations§
Source§impl SupervisorBuilder
impl SupervisorBuilder
Sourcepub fn add_worker(self, task: Task) -> Self
pub fn add_worker(self, task: Task) -> Self
Add a worker process.
Sourcepub fn shutdown(self, rx: Receiver<()>) -> Self
pub fn shutdown(self, rx: Receiver<()>) -> Self
Register a shutdown handler with the supervisor.
When a message is received on the shutdown receiver all managed processes are killed.
Sourcepub fn build(self) -> Supervisor
pub fn build(self) -> Supervisor
Return the supervisor.
Auto Trait Implementations§
impl Freeze for SupervisorBuilder
impl !RefUnwindSafe for SupervisorBuilder
impl Send for SupervisorBuilder
impl Sync for SupervisorBuilder
impl Unpin for SupervisorBuilder
impl !UnwindSafe for SupervisorBuilder
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