pub struct ChildSpec {
pub name: String,
pub actor_config: ActorConfig,
pub restart_policy: RestartPolicy,
pub shutdown_timeout: Duration,
pub significant: bool,
}Expand description
Specification for a supervised child actor.
Fields§
§name: StringUnique name for the child within this supervisor.
actor_config: ActorConfigStartup and behavioral configuration passed to the child actor on spawn, such as mailbox capacity, dispatch priority, and initialization parameters.
restart_policy: RestartPolicyWhen to restart the child.
shutdown_timeout: DurationHow long to wait for graceful shutdown before force-killing.
significant: boolIf true, abnormal termination escalates to parent supervisor.
Implementations§
Source§impl ChildSpec
impl ChildSpec
Sourcepub fn restart_policy(self, policy: RestartPolicy) -> Self
pub fn restart_policy(self, policy: RestartPolicy) -> Self
Set the restart policy.
Sourcepub fn shutdown_timeout(self, timeout: Duration) -> Self
pub fn shutdown_timeout(self, timeout: Duration) -> Self
Set the shutdown timeout.
Sourcepub fn significant(self, significant: bool) -> Self
pub fn significant(self, significant: bool) -> Self
Mark this child as significant (termination escalates).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChildSpec
impl RefUnwindSafe for ChildSpec
impl Send for ChildSpec
impl Sync for ChildSpec
impl Unpin for ChildSpec
impl UnsafeUnpin for ChildSpec
impl UnwindSafe for ChildSpec
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