[−][src]Struct act_zero::Addr
A strong reference to a spawned actor. Actors can be spawned using Addr::new
.
Methods can be called on the actor after it has been spawned using the
send!(...)
and call!(...)
macros.
Can be converted to the address of a trait-object using the upcast!(...)
macro.
Implementations
impl<T: Actor> Addr<T>
[src]
pub fn new<S: Spawn + ?Sized>(spawner: &S, value: T) -> Result<Self, SpawnError>
[src]
Spawn an actor using the given spawner. If successful returns the address of the actor.
impl<T: ?Sized> Addr<T>
[src]
impl<T: ?Sized + Send + 'static> Addr<T>
[src]
pub fn downgrade(&self) -> WeakAddr<T>
[src]
Downgrade to a weak reference, which does not try to keep the actor alive.
pub fn downcast<U: Send + 'static>(self) -> Result<Addr<U>, Addr<T>>
[src]
Attempt to downcast the address of a "trait-object actor" to a concrete type.
This function may succeed even when the cast would normally be unsuccessful if the address has become detached.
Trait Implementations
impl<T: Actor + ?Sized> AddrLike for Addr<T>
[src]
type Actor = T
Type of the actor reference by this address.
pub fn send_fut(&self, fut: impl Future<Output = ()> + Send + 'static)
[src]
pub fn call_fut<R: Send + 'static>(
&self,
fut: impl Future<Output = Produces<R>> + Send + 'static
) -> Produces<R>ⓘ
[src]
&self,
fut: impl Future<Output = Produces<R>> + Send + 'static
) -> Produces<R>ⓘ
pub fn send_fut_with<F: Future<Output = ()> + Send + 'static>(
&self,
f: impl FnOnce(Self) -> F
)
[src]
&self,
f: impl FnOnce(Self) -> F
)
pub fn call_fut_with<R: Send + 'static, F: Future<Output = Produces<R>> + Send + 'static>(
&self,
f: impl FnOnce(Self) -> F
) -> Produces<R>ⓘ
[src]
&self,
f: impl FnOnce(Self) -> F
) -> Produces<R>ⓘ
pub fn termination(&self) -> TerminationⓘNotable traits for Termination
impl Future for Termination type Output = ();
[src]
Notable traits for Termination
impl Future for Termination type Output = ();
impl<T: Actor + ?Sized> AsAddr for Addr<T>
[src]
impl<T: ?Sized> Clone for Addr<T>
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: ?Sized> Debug for Addr<T>
[src]
impl<T: ?Sized> Default for Addr<T>
[src]
impl<T: ?Sized> Eq for Addr<T>
[src]
impl<T: ?Sized> Hash for Addr<T>
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: ?Sized> Ord for Addr<T>
[src]
pub fn cmp(&self, rhs: &Addr<T>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: ?Sized, U: ?Sized> PartialEq<Addr<U>> for Addr<T>
[src]
pub fn eq(&self, rhs: &Addr<U>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ?Sized, U: ?Sized> PartialEq<Addr<U>> for WeakAddr<T>
[src]
pub fn eq(&self, rhs: &Addr<U>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ?Sized, U: ?Sized> PartialEq<WeakAddr<U>> for Addr<T>
[src]
pub fn eq(&self, rhs: &WeakAddr<U>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ?Sized, U: ?Sized> PartialOrd<Addr<U>> for Addr<T>
[src]
pub fn partial_cmp(&self, rhs: &Addr<U>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ?Sized, U: ?Sized> PartialOrd<Addr<U>> for WeakAddr<T>
[src]
pub fn partial_cmp(&self, rhs: &Addr<U>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ?Sized, U: ?Sized> PartialOrd<WeakAddr<U>> for Addr<T>
[src]
pub fn partial_cmp(&self, rhs: &WeakAddr<U>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Addr<T>
[src]
impl<T: ?Sized> Send for Addr<T>
[src]
impl<T: ?Sized> Sync for Addr<T>
[src]
impl<T: ?Sized> Unpin for Addr<T>
[src]
impl<T> !UnwindSafe for Addr<T>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,