pub struct ActorConfig {
pub mailbox: MailboxConfig,
pub supervision: Option<SupervisionConfig>,
}Expand description
Configuration for spawning an actor.
Fields§
§mailbox: MailboxConfigMailbox configuration.
supervision: Option<SupervisionConfig>Supervision configuration. Some if this actor is a supervisor.
Implementations§
Source§impl ActorConfig
impl ActorConfig
Sourcepub fn with_mailbox_capacity(self, capacity: usize) -> Self
pub fn with_mailbox_capacity(self, capacity: usize) -> Self
Sets the mailbox capacity.
Sourcepub fn with_mailbox(self, mailbox: MailboxConfig) -> Self
pub fn with_mailbox(self, mailbox: MailboxConfig) -> Self
Sets the complete mailbox configuration.
Sourcepub fn supervised(self) -> Self
pub fn supervised(self) -> Self
Enables supervision with default configuration (OneForOne, 3 restarts / 5s).
Sourcepub fn with_supervision(self, config: SupervisionConfig) -> Self
pub fn with_supervision(self, config: SupervisionConfig) -> Self
Enables supervision with a custom configuration.
Trait Implementations§
Source§impl Clone for ActorConfig
impl Clone for ActorConfig
Source§fn clone(&self) -> ActorConfig
fn clone(&self) -> ActorConfig
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 moreSource§impl Debug for ActorConfig
impl Debug for ActorConfig
Source§impl Default for ActorConfig
impl Default for ActorConfig
Source§fn default() -> ActorConfig
fn default() -> ActorConfig
Returns the “default value” for a type. Read more
Source§impl<'a> From<&'a ActorConfig> for ActorConfig
impl<'a> From<&'a ActorConfig> for ActorConfig
Source§fn from(value: &'a ActorConfig) -> Self
fn from(value: &'a ActorConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ActorConfig
impl RefUnwindSafe for ActorConfig
impl Send for ActorConfig
impl Sync for ActorConfig
impl Unpin for ActorConfig
impl UnsafeUnpin for ActorConfig
impl UnwindSafe for ActorConfig
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