[][src]Struct riker::actor::BasicActorRef

pub struct BasicActorRef {
    pub cell: ActorCell,
}

A lightweight, un-typed reference to interact with its underlying actor instance through concurrent messaging.

BasicActorRef can be derived from an original ActorRef<Msg>.

BasicActorRef allows for un-typed messaging using try_tell, that will return a Result. If the message type was not supported, the result will contain an Error.

BasicActorRef can be used when the original ActorRef isn't available, when you need to use collections to store references from different actor types, or when using actor selections to message parts of the actor hierarchy.

In general, it is better to use ActorRef where possible.

Fields

cell: ActorCell

Implementations

impl BasicActorRef[src]

pub fn typed<Msg: Message>(&self, cell: ExtendedCell<Msg>) -> ActorRef<Msg>[src]

pub fn try_tell<Msg>(
    &self,
    msg: Msg,
    sender: impl Into<Option<BasicActorRef>>
) -> Result<(), ()> where
    Msg: Message + Send
[src]

Send a message to this actor

Returns a result. If the message type is not supported Error is returned.

pub fn try_tell_any(
    &self,
    msg: &mut AnyMessage,
    sender: impl Into<Option<BasicActorRef>>
) -> Result<(), ()>
[src]

Trait Implementations

impl ActorReference for BasicActorRef[src]

fn name(&self) -> &str[src]

Actor name.

Unique among siblings.

fn path(&self) -> &ActorPath[src]

Actor path.

e.g. /user/actor_a/actor_b

fn parent(&self) -> BasicActorRef[src]

Parent reference.

fn children<'a>(&'a self) -> Box<dyn Iterator<Item = BasicActorRef> + 'a>[src]

Iterator over children references.

impl<'_> ActorReference for &'_ BasicActorRef[src]

fn name(&self) -> &str[src]

Actor name.

Unique among siblings.

fn path(&self) -> &ActorPath[src]

Actor path.

e.g. /user/actor_a/actor_b

fn parent(&self) -> BasicActorRef[src]

Parent reference.

fn children<'a>(&'a self) -> Box<dyn Iterator<Item = BasicActorRef> + 'a>[src]

Iterator over children references.

impl Clone for BasicActorRef[src]

impl Debug for BasicActorRef[src]

impl Display for BasicActorRef[src]

impl<Msg> From<ActorRef<Msg>> for BasicActorRef where
    Msg: Message
[src]

impl PartialEq<BasicActorRef> for BasicActorRef[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Message for T where
    T: 'static + Clone + Send + Debug
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,