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
sourceimpl<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> !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
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