pub struct ChildSpec {
pub id: String,
pub restart: Restart,
pub spawn_fn: SpawnFn,
pub backoff_fn: Option<ChildBackoffFn>,
pub restart_counter_reset_after: Option<u64>,
}Expand description
Defines how to spawn and manage a single child actor.
Fields§
§id: StringUnique child ID string (for logging, meltdown log, etc.).
restart: RestartRestart policy for this child. Restart::Permanent, Restart::Transient, Restart::Temporary.
spawn_fn: SpawnFnThe user-defined spawn closure. If this fails, meltdown is triggered if repeated too often.
backoff_fn: Option<ChildBackoffFn>A child-level backoff function. If set, this can delay re-spawning the child after a crash.
restart_counter_reset_after: Option<u64>Optional child-level meltdown “reset.” If the child hasn’t failed in restart_counter_reset_after seconds,
we reset this child’s failure count to 0 next time it fails.
This is separate from the supervisor-level meltdown logic in SupervisorOptions.
Auto Trait Implementations§
impl Freeze for ChildSpec
impl !RefUnwindSafe for ChildSpec
impl Send for ChildSpec
impl Sync for ChildSpec
impl Unpin 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
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> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage