pub struct ActorContext {
pub actor_id: ActorId,
pub actor_name: String,
pub supervisor: Option<ActorRef>,
pub children: HashMap<ActorId, ActorRef>,
/* private fields */
}Expand description
Actor context provided during message handling
Fields§
§actor_id: ActorId§actor_name: String§supervisor: Option<ActorRef>§children: HashMap<ActorId, ActorRef>Implementations§
Source§impl ActorContext
impl ActorContext
Sourcepub fn spawn_child<B: ActorBehavior>(
&mut self,
name: String,
behavior: B,
) -> Result<ActorRef>
pub fn spawn_child<B: ActorBehavior>( &mut self, name: String, behavior: B, ) -> Result<ActorRef>
Sourcepub fn stop_child(&mut self, child_id: ActorId) -> Result<()>
pub fn stop_child(&mut self, child_id: ActorId) -> Result<()>
Auto Trait Implementations§
impl Freeze for ActorContext
impl RefUnwindSafe for ActorContext
impl Send for ActorContext
impl Sync for ActorContext
impl Unpin for ActorContext
impl UnwindSafe for ActorContext
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more