pub struct SupervisorBuilder { /* private fields */ }Expand description
Builder for constructing a Supervisor.
§Example
ⓘ
use super_visor::Supervisor;
let supervisor = Supervisor::builder()
.add_proc(server)
.add_proc(worker)
.add_proc(sink)
.build();Implementations§
Source§impl SupervisorBuilder
impl SupervisorBuilder
Sourcepub fn add_proc(self, proc: impl ManagedProc + 'static) -> Self
pub fn add_proc(self, proc: impl ManagedProc + 'static) -> Self
Adds a process to the builder
Processes are started in the order they are registered and shut down in reverse order.
Sourcepub fn build(self) -> Supervisor
pub fn build(self) -> Supervisor
Consumes the builder and returns a configured 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