pub struct Addr<A> { /* private fields */ }
Expand description
Implementations
sourceimpl<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>
sourceimpl<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> !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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more