pub struct NestedSupervisorBuilder<'a, S = Restartable> { /* private fields */ }Expand description
Builder for a yet-to-be-started nested supervisor.
The counterpart to ChildBuilder for a child that is itself a Supervisor, and deliberately a much smaller
surface. A nested supervisor has no placement of its own (it runs wherever its parent does, and its children carry
their own placement) and no shutdown deadline of its own (it bounds its own drain through its children), so what
is left to configure is the restart policy and significance.
Uses the same typestate as ChildBuilder: significance is offered only once the restart policy has been
narrowed to one that lets the child terminate for good, since a permanent child is always brought back and so
never has a termination for the parent to act on.
Implementations§
Source§impl<'a, S: BuilderState> NestedSupervisorBuilder<'a, S>
impl<'a, S: BuilderState> NestedSupervisorBuilder<'a, S>
Sourcepub fn build(self) -> ChildSpecification<SupervisorSpec>
pub fn build(self) -> ChildSpecification<SupervisorSpec>
Finishes describing the child without starting it, for Supervisor::add_worker.
Use this to register a configured subtree on a supervisor that hasn’t started yet; spawn is
the counterpart for a supervisor that is already running.
Whichever supervisor this builder was created against is irrelevant here – the child belongs to whichever one it is handed to.
Source§impl<'a> NestedSupervisorBuilder<'a, Restartable>
impl<'a> NestedSupervisorBuilder<'a, Restartable>
Sourcepub fn transient(self) -> NestedSupervisorBuilder<'a, Terminable>
pub fn transient(self) -> NestedSupervisorBuilder<'a, Terminable>
Restarts this subtree only when it terminates abnormally.
Narrows the restart policy to RestartType::Transient, which makes
with_significant available.
Sourcepub fn temporary(self) -> NestedSupervisorBuilder<'a, Terminable>
pub fn temporary(self) -> NestedSupervisorBuilder<'a, Terminable>
Never restarts this subtree.
Narrows the restart policy to RestartType::Temporary, which makes
with_significant available.
Source§impl<S: CanTerminate> NestedSupervisorBuilder<'_, S>
impl<S: CanTerminate> NestedSupervisorBuilder<'_, S>
Sourcepub fn with_significant(self, significant: bool) -> Self
pub fn with_significant(self, significant: bool) -> Self
Sets whether this subtree’s termination should stop the parent supervisor.
See ChildBuilder::with_significant, which this mirrors.
Auto Trait Implementations§
impl<'a, S> Freeze for NestedSupervisorBuilder<'a, S>
impl<'a, S = Restartable> !RefUnwindSafe for NestedSupervisorBuilder<'a, S>
impl<'a, S> Send for NestedSupervisorBuilder<'a, S>where
S: Send,
impl<'a, S> Sync for NestedSupervisorBuilder<'a, S>where
S: Sync,
impl<'a, S> Unpin for NestedSupervisorBuilder<'a, S>where
S: Unpin,
impl<'a, S = Restartable> !UnwindSafe for NestedSupervisorBuilder<'a, S>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read more§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more