[][src]Trait act_zero::AddrLike

pub trait AddrLike: Send + Sync + Clone + Debug + 'static + AsAddr<Addr = Self> {
    type Actor: Actor + ?Sized;
    pub fn send_fut(&self, fut: impl Future<Output = ()> + Send + 'static);

    pub fn call_fut<R: Send + 'static>(
        &self,
        fut: impl Future<Output = Produces<R>> + Send + 'static
    ) -> Produces<R>

Notable traits for Produces<T>

impl<T> Future for Produces<T> type Output = Result<T, Canceled>;
{ ... }
pub fn send_fut_with<F: Future<Output = ()> + Send + 'static>(
        &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>

Notable traits for Produces<T>

impl<T> Future for Produces<T> type Output = Result<T, Canceled>;
{ ... }
pub fn termination(&self) -> Termination

Notable traits for Termination

impl Future for Termination type Output = ();
{ ... } }

Trait provides methods for spawning futures onto an actor. Implemented by Addr and WeakAddr alike.

Associated Types

type Actor: Actor + ?Sized[src]

Type of the actor reference by this address.

Loading content...

Required methods

pub fn send_fut(&self, fut: impl Future<Output = ()> + Send + 'static)[src]

Spawn a future onto the actor which does not return a value.

Loading content...

Provided methods

pub fn call_fut<R: Send + 'static>(
    &self,
    fut: impl Future<Output = Produces<R>> + Send + 'static
) -> Produces<R>

Notable traits for Produces<T>

impl<T> Future for Produces<T> type Output = Result<T, Canceled>;
[src]

Spawn a future onto the actor and provide the means to get back the result. The future will be cancelled if the receiver is dropped before it has completed.

pub fn send_fut_with<F: Future<Output = ()> + Send + 'static>(
    &self,
    f: impl FnOnce(Self) -> F
)
[src]

Equivalent to send_fut but provides access to the actor's address.

pub fn call_fut_with<R: Send + 'static, F: Future<Output = Produces<R>> + Send + 'static>(
    &self,
    f: impl FnOnce(Self) -> F
) -> Produces<R>

Notable traits for Produces<T>

impl<T> Future for Produces<T> type Output = Result<T, Canceled>;
[src]

Equivalent to call_fut but provides access to the actor's address.

pub fn termination(&self) -> Termination

Notable traits for Termination

impl Future for Termination type Output = ();
[src]

Returns a future which resolves when the actor terminates. If the actor has already terminated, or if this address is detached, the future will resolve immediately.

Loading content...

Implementors

impl<T: Actor + ?Sized> AddrLike for Addr<T>[src]

type Actor = T

impl<T: Actor + ?Sized> AddrLike for WeakAddr<T>[src]

type Actor = T

Loading content...