[][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

Methods

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]

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

impl Clone for BasicActorRef[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

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

impl PartialEq<BasicActorRef> for BasicActorRef[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Display for BasicActorRef[src]

impl Debug for BasicActorRef[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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> From<T> for T[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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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