[][src]Trait act_zero::AddrLike

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

    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>;
{ ... }
fn send_fut_with<F: Future<Output = ()> + Send + 'static>(
        &self,
        f: impl FnOnce(Self) -> F
    ) { ... }
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>;
{ ... }
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

Type of the actor reference by this address.

Loading content...

Required methods

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

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

Loading content...

Provided methods

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>;

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.

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

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

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>;

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

fn termination(&self) -> Termination

Notable traits for Termination

impl Future for Termination type Output = ();

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...