[][src]Trait sealrs::actors::abstract_actor_ref::AbstractActorRef

pub trait AbstractActorRef: Display {
    fn tell(&mut self, msg: Message, rself: Option<&ActorRef>);
fn ask(
        &mut self,
        factory: &mut dyn AbstractActorSystem,
        msg: Message
    ) -> WrappedFuture<Message, AskTimeoutError>;
fn ask_timeout(
        &mut self,
        factory: &mut dyn AbstractActorSystem,
        timeout: Duration,
        msg: Message
    ) -> WrappedFuture<Message, AskTimeoutError>;
fn path(&self) -> ActorPath;
fn cell(&mut self) -> TSafe<ActorCell>;
fn clone(&self) -> ActorRef;
fn as_any(&self) -> Box<dyn Any>; }

Required methods

fn tell(&mut self, msg: Message, rself: Option<&ActorRef>)

fn ask(
    &mut self,
    factory: &mut dyn AbstractActorSystem,
    msg: Message
) -> WrappedFuture<Message, AskTimeoutError>

fn ask_timeout(
    &mut self,
    factory: &mut dyn AbstractActorSystem,
    timeout: Duration,
    msg: Message
) -> WrappedFuture<Message, AskTimeoutError>

fn path(&self) -> ActorPath

fn cell(&mut self) -> TSafe<ActorCell>

fn clone(&self) -> ActorRef

fn as_any(&self) -> Box<dyn Any>

Loading content...

Implementors

impl AbstractActorRef for LocalActorRef[src]

fn tell(&mut self, msg: Message, rself: Option<&ActorRef>)[src]

Send message to the actor behind the reference. In the first argument passed message for send, and in the second argument specified sender reference. This reference will be injected to ctx.sender field the actor context object. If sender was does not specified, ctx.sender will be filled with the deadLetter actor reference. Setting up None as sender reference is useful in case, when tell operation is called from outside of the actor system.

Examples

fn ask(
    &mut self,
    factory: &mut dyn AbstractActorSystem,
    msg: Message
) -> WrappedFuture<Message, AskTimeoutError>
[src]

Call ask_timeout with default timeout

fn ask_timeout(
    &mut self,
    factory: &mut dyn AbstractActorSystem,
    timeout: Duration,
    msg: Message
) -> WrappedFuture<Message, AskTimeoutError>
[src]

Sends a message to the target actor and expects that he respond to that message. Expectation represent as future, which will be completed with received message or will be failed with AskTimeoutError, if target actor will not respond with specified timeout.

Example

first.ask(&mut (*ctx.system()), Duration::from_secs(3), msg!(SomeMsg {}))
    .on_complete(|v| {
        // Do something with result (or error)
    });

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

Return copy of the actor path object

impl AbstractActorRef for TestLocalActorRef[src]

fn tell(&mut self, msg: Message, rself: Option<&ActorRef>)[src]

Identical to original

fn ask(
    &mut self,
    factory: &mut dyn AbstractActorSystem,
    msg: Message
) -> WrappedFuture<Message, AskTimeoutError>
[src]

Identical to original

fn ask_timeout(
    &mut self,
    factory: &mut dyn AbstractActorSystem,
    timeout: Duration,
    msg: Message
) -> WrappedFuture<Message, AskTimeoutError>
[src]

Identical to original

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

Identical to original

fn cell(&mut self) -> TSafe<ActorCell>[src]

Identical to original

fn clone(&self) -> ActorRef[src]

Identical to original

fn as_any(&self) -> Box<dyn Any>[src]

Identical to original

Loading content...