pub struct WeakAddr<A> { /* private fields */ }
Expand description
Weak version of Addr<A>
.
This address will not prolong the lifetime of the actor.
In order to use a WeakAddr<A>
you need to “upgrade” it to a proper Addr<A>
.
Implementations§
source§impl<A> WeakAddr<A>
impl<A> WeakAddr<A>
sourcepub fn upgrade(&self) -> Option<Addr<A>>
pub fn upgrade(&self) -> Option<Addr<A>>
Attempts to turn a WeakAddr<A>
into an Addr<A>
.
If the original Addr<A>
has already been dropped this method will return None
sourcepub fn upgrade_send<T: Message<Result = ()>>(&self, msg: T) -> Result<()>where
A: Handler<T>,
pub fn upgrade_send<T: Message<Result = ()>>(&self, msg: T) -> Result<()>where
A: Handler<T>,
Try to upgrade to Addr
and call Addr::send
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for WeakAddr<A>
impl<A> !RefUnwindSafe for WeakAddr<A>
impl<A> Send for WeakAddr<A>
impl<A> Sync for WeakAddr<A>
impl<A> Unpin for WeakAddr<A>
impl<A> !UnwindSafe for WeakAddr<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