Trait actix::fut::future::ActorFutureExt

source ·
pub trait ActorFutureExt<A: Actor>: ActorFuture<A> {
    // Provided methods
    fn map<F, U>(self, f: F) -> Map<Self, F>
       where F: FnOnce(Self::Output, &mut A, &mut A::Context) -> U,
             Self: Sized { ... }
    fn then<F, Fut>(self, f: F) -> Then<Self, Fut, F>
       where F: FnOnce(Self::Output, &mut A, &mut A::Context) -> Fut,
             Fut: ActorFuture<A>,
             Self: Sized { ... }
    fn timeout(self, timeout: Duration) -> Timeout<Self>
       where Self: Sized { ... }
    fn boxed_local(self) -> LocalBoxActorFuture<A, Self::Output>
       where Self: Sized + 'static { ... }
}

Provided Methods§

source

fn map<F, U>(self, f: F) -> Map<Self, F>
where F: FnOnce(Self::Output, &mut A, &mut A::Context) -> U, Self: Sized,

Map this future’s result to a different type, returning a new future of the resulting type.

source

fn then<F, Fut>(self, f: F) -> Then<Self, Fut, F>
where F: FnOnce(Self::Output, &mut A, &mut A::Context) -> Fut, Fut: ActorFuture<A>, Self: Sized,

Chain on a computation for when a future finished, passing the result of the future to the provided closure f.

source

fn timeout(self, timeout: Duration) -> Timeout<Self>
where Self: Sized,

Add timeout to futures chain.

Err(()) returned as a timeout error.

source

fn boxed_local(self) -> LocalBoxActorFuture<A, Self::Output>
where Self: Sized + 'static,

Wrap the future in a Box, pinning it.

A shortcut for wrapping in Box::pin.

Implementors§

source§

impl<F, A> ActorFutureExt<A> for F
where F: ActorFuture<A>, A: Actor,