pub struct Addr<A> { /* private fields */ }
Expand description
Implementations§
source§impl<A> Addr<A>
impl<A> Addr<A>
sourcepub fn downgrade(&self) -> WeakAddr<A>
pub fn downgrade(&self) -> WeakAddr<A>
Turns an Addr<A>
into a WeakAddr<A>
source§impl<A: Actor> Addr<A>
impl<A: Actor> Addr<A>
sourcepub fn stop_supervisor(&mut self, err: Option<Error>) -> Result<()>
pub fn stop_supervisor(&mut self, err: Option<Error>) -> Result<()>
Stop the supervisor.
this is ignored by normal actors
pub fn stopped(&self) -> bool
sourcepub async fn call<T: Message>(&self, msg: T) -> Result<T::Result>where
A: Handler<T>,
pub async fn call<T: Message>(&self, msg: T) -> Result<T::Result>where
A: Handler<T>,
Send a message msg
to the actor and wait for the return value.
sourcepub fn send<T: Message<Result = ()>>(&self, msg: T) -> Result<()>where
A: Handler<T>,
pub fn send<T: Message<Result = ()>>(&self, msg: T) -> Result<()>where
A: Handler<T>,
Send a message msg
to the actor without waiting for the return value.
sourcepub fn caller<T: Message>(&self) -> Caller<T>where
A: Handler<T>,
pub fn caller<T: Message>(&self) -> Caller<T>where
A: Handler<T>,
Create a Caller<T>
for a specific message type
sourcepub fn sender<T: Message<Result = ()>>(&self) -> Sender<T>where
A: Handler<T>,
pub fn sender<T: Message<Result = ()>>(&self) -> Sender<T>where
A: Handler<T>,
Create a Sender<T>
for a specific message type
sourcepub async fn wait_for_stop(self)
pub async fn wait_for_stop(self)
Wait for an actor to finish, and if the actor has finished, the function returns immediately.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Addr<A>
impl<A> !RefUnwindSafe for Addr<A>
impl<A> Send for Addr<A>
impl<A> Sync for Addr<A>
impl<A> Unpin for Addr<A>
impl<A> !UnwindSafe for Addr<A>
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