Trait actix::fut::ActorFuture
[−]
[src]
pub trait ActorFuture { type Item; type Error; type Actor: Actor; fn poll(
&mut self,
srv: &mut Self::Actor,
ctx: &mut <Self::Actor as Actor>::Context
) -> Poll<Self::Item, Self::Error>; fn map<F, U>(self, f: F) -> Map<Self, F>
where
F: FnOnce(Self::Item, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> U,
Self: Sized, { ... } fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
where
F: FnOnce(Self::Error, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> E,
Self: Sized, { ... } fn drop_err(self) -> DropErr<Self>
where
Self: Sized, { ... } fn then<F, B>(self, f: F) -> Then<Self, B, F>
where
F: FnOnce(Result<Self::Item, Self::Error>, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> B,
B: IntoActorFuture<Actor = Self::Actor>,
Self: Sized, { ... } fn and_then<F, B>(self, f: F) -> AndThen<Self, B, F>
where
F: FnOnce(Self::Item, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> B,
B: IntoActorFuture<Error = Self::Error, Actor = Self::Actor>,
Self: Sized, { ... } }
Trait for types which are a placeholder of a value that may become available at some later point in time.
This is similar to futures::Future
trait, except it works with Actor
Associated Types
type Item
The type of value that this future will resolved with if it is successful.
type Error
The type of error that this future will resolve with if it fails in a normal fashion.
type Actor: Actor
The actor within which this future runs
Required Methods
fn poll(
&mut self,
srv: &mut Self::Actor,
ctx: &mut <Self::Actor as Actor>::Context
) -> Poll<Self::Item, Self::Error>
&mut self,
srv: &mut Self::Actor,
ctx: &mut <Self::Actor as Actor>::Context
) -> Poll<Self::Item, Self::Error>
Provided Methods
fn map<F, U>(self, f: F) -> Map<Self, F> where
F: FnOnce(Self::Item, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> U,
Self: Sized,
F: FnOnce(Self::Item, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> U,
Self: Sized,
Map this future's result to a different type, returning a new future of the resulting type.
fn map_err<F, E>(self, f: F) -> MapErr<Self, F> where
F: FnOnce(Self::Error, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> E,
Self: Sized,
F: FnOnce(Self::Error, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> E,
Self: Sized,
Map this future's error to a different error, returning a new future.
fn drop_err(self) -> DropErr<Self> where
Self: Sized,
Self: Sized,
Drop this future's error, returning a new future.
fn then<F, B>(self, f: F) -> Then<Self, B, F> where
F: FnOnce(Result<Self::Item, Self::Error>, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> B,
B: IntoActorFuture<Actor = Self::Actor>,
Self: Sized,
F: FnOnce(Result<Self::Item, Self::Error>, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> B,
B: IntoActorFuture<Actor = Self::Actor>,
Self: Sized,
Chain on a computation for when a future finished, passing the result of
the future to the provided closure f
.
fn and_then<F, B>(self, f: F) -> AndThen<Self, B, F> where
F: FnOnce(Self::Item, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> B,
B: IntoActorFuture<Error = Self::Error, Actor = Self::Actor>,
Self: Sized,
F: FnOnce(Self::Item, &mut Self::Actor, &mut <Self::Actor as Actor>::Context) -> B,
B: IntoActorFuture<Error = Self::Error, Actor = Self::Actor>,
Self: Sized,
Execute another future after this one has resolved successfully.
Implementors
impl<A, M> ActorFuture for Request<A, M> where
A: Actor,
M: ResponseType, type Item = Result<M::Item, M::Error>; type Error = Canceled; type Actor = A;impl<A, B, F> ActorFuture for AndThen<A, B, F> where
A: ActorFuture,
B: IntoActorFuture<Actor = A::Actor, Error = A::Error>,
F: FnOnce(A::Item, &mut A::Actor, &mut <A::Actor as Actor>::Context) -> B, type Item = B::Item; type Error = B::Error; type Actor = A::Actor;impl<A, B> ActorFuture for Either<A, B> where
A: ActorFuture,
B: ActorFuture<Item = A::Item, Error = A::Error, Actor = A::Actor>, type Item = A::Item; type Error = A::Error; type Actor = A::Actor;impl<T, E, A> ActorFuture for FutureResult<T, E, A> where
A: Actor, type Item = T; type Error = E; type Actor = A;impl<A, B, F> ActorFuture for Then<A, B, F> where
A: ActorFuture,
B: IntoActorFuture<Actor = A::Actor>,
F: FnOnce(Result<A::Item, A::Error>, &mut A::Actor, &mut <A::Actor as Actor>::Context) -> B, type Item = B::Item; type Error = B::Error; type Actor = A::Actor;impl<U, A, F> ActorFuture for Map<A, F> where
A: ActorFuture,
F: FnOnce(A::Item, &mut A::Actor, &mut <A::Actor as Actor>::Context) -> U, type Item = U; type Error = A::Error; type Actor = A::Actor;impl<U, A, F> ActorFuture for MapErr<A, F> where
A: ActorFuture,
F: FnOnce(A::Error, &mut A::Actor, &mut <A::Actor as Actor>::Context) -> U, type Item = A::Item; type Error = U; type Actor = A::Actor;impl<A> ActorFuture for DropErr<A> where
A: ActorFuture, type Item = A::Item; type Error = (); type Actor = A::Actor;impl<S> ActorFuture for StreamFinish<S> where
S: ActorStream, type Item = (); type Error = S::Error; type Actor = S::Actor;impl<F, A> ActorFuture for FutureWrap<F, A> where
F: Future,
A: Actor, type Item = F::Item; type Error = F::Error; type Actor = A;