[−][src]Struct riker::actor::ActorRef
A lightweight, typed reference to interact with its underlying actor instance through concurrent messaging.
All ActorRefs are products of system.actor_of
or context.actor_of
. When an actor is created using actor_of
an ActorRef<Msg>
is returned, where Msg
is the mailbox
message type for the actor.
Actor references are lightweight and can be cloned without concern for memory use.
Messages sent to an actor are added to the actor's mailbox.
In the event that the underlying actor is terminated messages sent to the actor will be routed to dead letters.
If an actor is restarted all existing references continue to be valid.
Fields
cell: ExtendedCell<Msg>
Implementations
impl<Msg: Message> ActorRef<Msg>
[src]
pub fn send_msg(&self, msg: Msg, sender: impl Into<Option<BasicActorRef>>)
[src]
Trait Implementations
impl<Msg: Message> ActorReference for ActorRef<Msg>
[src]
pub fn name(&self) -> &str
[src]
Actor name.
Unique among siblings.
pub fn uri(&self) -> &ActorUri
[src]
pub fn path(&self) -> &ActorPath
[src]
Actor path.
e.g. /user/actor_a/actor_b
pub fn is_root(&self) -> bool
[src]
pub fn parent(&self) -> BasicActorRef
[src]
Parent reference.
pub fn user_root(&self) -> BasicActorRef
[src]
pub fn has_children(&self) -> bool
[src]
pub fn is_child(&self, actor: &BasicActorRef) -> bool
[src]
pub fn children<'a>(&'a self) -> Box<dyn Iterator<Item = BasicActorRef> + 'a>
[src]
Iterator over children references.
pub fn sys_tell(&self, msg: SystemMsg)
[src]
impl<Msg: Message, '_> ActorReference for &'_ ActorRef<Msg>
[src]
pub fn name(&self) -> &str
[src]
Actor name.
Unique among siblings.
pub fn uri(&self) -> &ActorUri
[src]
pub fn path(&self) -> &ActorPath
[src]
Actor path.
e.g. /user/actor_a/actor_b
pub fn is_root(&self) -> bool
[src]
pub fn parent(&self) -> BasicActorRef
[src]
Parent reference.
pub fn user_root(&self) -> BasicActorRef
[src]
pub fn has_children(&self) -> bool
[src]
pub fn is_child(&self, actor: &BasicActorRef) -> bool
[src]
pub fn children<'a>(&'a self) -> Box<dyn Iterator<Item = BasicActorRef> + 'a>
[src]
Iterator over children references.
pub fn sys_tell(&self, msg: SystemMsg)
[src]
impl<Msg: Clone + Message> Clone for ActorRef<Msg>
[src]
impl<Msg: Message> Debug for ActorRef<Msg>
[src]
impl<Msg: Message> Display for ActorRef<Msg>
[src]
impl<Msg> From<ActorRef<Msg>> for BasicActorRef where
Msg: Message,
[src]
Msg: Message,
pub fn from(actor: ActorRef<Msg>) -> BasicActorRef
[src]
impl<Msg> From<ActorRef<Msg>> for Option<BasicActorRef> where
Msg: Message,
[src]
Msg: Message,
pub fn from(actor: ActorRef<Msg>) -> Option<BasicActorRef>
[src]
impl<Msg: Message> PartialEq<ActorRef<Msg>> for ActorRef<Msg>
[src]
pub fn eq(&self, other: &ActorRef<Msg>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T, M> Tell<T> for ActorRef<M> where
T: Message + Into<M>,
M: Message,
[src]
T: Message + Into<M>,
M: Message,
Auto Trait Implementations
impl<Msg> !RefUnwindSafe for ActorRef<Msg>
impl<Msg> Send for ActorRef<Msg>
impl<Msg> Sync for ActorRef<Msg>
impl<Msg> Unpin for ActorRef<Msg>
impl<Msg> !UnwindSafe for ActorRef<Msg>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Message for T where
T: 'static + Clone + Send + Debug,
[src]
T: 'static + Clone + Send + Debug,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,