pub struct SpawnConfig {
pub name: String,
pub capacity: usize,
pub control_capacity: usize,
pub restart_policy: RestartPolicy,
pub restart_mailbox_policy: RestartMailboxPolicy,
pub shutdown_mode: ShutdownMode,
pub overload: OverloadConfig,
pub initial_snapshot: Option<Vec<u8>>,
pub extra_guards: Vec<Arc<dyn SpawnGuard>>,
}Fields§
§name: String§capacity: usize§control_capacity: usize§restart_policy: RestartPolicy§restart_mailbox_policy: RestartMailboxPolicy§shutdown_mode: ShutdownMode§overload: OverloadConfig§initial_snapshot: Option<Vec<u8>>§extra_guards: Vec<Arc<dyn SpawnGuard>>Implementations§
Source§impl SpawnConfig
impl SpawnConfig
pub fn new(name: impl Into<String>, capacity: usize) -> Self
Sourcepub fn new_stateful(name: impl Into<String>, capacity: usize) -> Self
pub fn new_stateful(name: impl Into<String>, capacity: usize) -> Self
Convenience constructor for stateful/distributed actors.
Sets restart mailbox behavior to DrainAndDrop.
pub fn push_guard(&mut self, guard: Arc<dyn SpawnGuard>)
pub fn restart_on_panic( self, max_restarts: usize, min_backoff: Duration, max_backoff: Duration, ) -> Self
pub fn shutdown_graceful(self, deadline: Duration) -> Self
pub fn restart_mailbox_policy(self, policy: RestartMailboxPolicy) -> Self
pub fn restart_mailbox_drain_and_drop(self) -> Self
pub fn restart_mailbox_keep(self) -> Self
pub fn control_capacity(self, capacity: usize) -> Self
pub fn overload(self, overload: OverloadConfig) -> Self
pub fn initial_snapshot(self, snapshot: Vec<u8>) -> Self
Trait Implementations§
Source§impl Clone for SpawnConfig
impl Clone for SpawnConfig
Source§fn clone(&self) -> SpawnConfig
fn clone(&self) -> SpawnConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SpawnConfig
impl !RefUnwindSafe for SpawnConfig
impl Send for SpawnConfig
impl Sync for SpawnConfig
impl Unpin for SpawnConfig
impl UnsafeUnpin for SpawnConfig
impl !UnwindSafe for SpawnConfig
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