Trait finchers_ext::EndpointExt
[−]
[src]
pub trait EndpointExt: Endpoint + Sized { fn as_t<T>(self) -> Self
where
Self: Endpoint<Output = T>, { ... } fn and<E>(self, e: E) -> And<Self, E::Endpoint>
where
E: IntoEndpoint,
Self::Output: Send,
E::Output: Send, { ... } fn left<E>(self, e: E) -> Left<Self, E::Endpoint>
where
E: IntoEndpoint, { ... } fn right<E>(self, e: E) -> Right<Self, E::Endpoint>
where
E: IntoEndpoint, { ... } fn or<E>(self, e: E) -> Or<Self, E::Endpoint>
where
E: IntoEndpoint<Output = Self::Output>, { ... } fn lift(self) -> Lift<Self> { ... } fn map<F, U>(self, f: F) -> Map<Self, F>
where
F: FnOnce(Self::Output) -> U + Clone + Send + Sync, { ... } fn inspect<F>(self, f: F) -> Inspect<Self, F>
where
F: FnOnce(&Self::Output) + Clone + Send + Sync, { ... } fn map_async<F, T>(self, f: F) -> MapAsync<Self, F>
where
F: FnOnce(Self::Output) -> T + Clone + Send + Sync,
T: IntoTask,
T::Task: Send, { ... } }
A set of extension methods used for composing complicate endpoints.
Provided Methods
fn as_t<T>(self) -> Self where
Self: Endpoint<Output = T>,
Self: Endpoint<Output = T>,
Annotate that the associated type Output
is equal to T
.
fn and<E>(self, e: E) -> And<Self, E::Endpoint> where
E: IntoEndpoint,
Self::Output: Send,
E::Output: Send,
E: IntoEndpoint,
Self::Output: Send,
E::Output: Send,
Create an endpoint which evaluates self
and e
and returns a pair of their tasks.
The returned future from this endpoint contains both futures from
self
and e
and resolved as a pair of values returned from theirs.
fn left<E>(self, e: E) -> Left<Self, E::Endpoint> where
E: IntoEndpoint,
E: IntoEndpoint,
Create an endpoint which evaluates self
and e
and returns the task of self
if matched.
fn right<E>(self, e: E) -> Right<Self, E::Endpoint> where
E: IntoEndpoint,
E: IntoEndpoint,
Create an endpoint which evaluates self
and e
and returns the task of e
if matched.
fn or<E>(self, e: E) -> Or<Self, E::Endpoint> where
E: IntoEndpoint<Output = Self::Output>,
E: IntoEndpoint<Output = Self::Output>,
Create an endpoint which evaluates self
and e
sequentially.
The returned future from this endpoint contains the one returned
from either self
or e
matched "better" to the input.
fn lift(self) -> Lift<Self>
Create an endpoint which returns None
if the inner endpoint skips the request.
fn map<F, U>(self, f: F) -> Map<Self, F> where
F: FnOnce(Self::Output) -> U + Clone + Send + Sync,
F: FnOnce(Self::Output) -> U + Clone + Send + Sync,
Create an endpoint which maps the returned value to a different type.
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnOnce(&Self::Output) + Clone + Send + Sync,
F: FnOnce(&Self::Output) + Clone + Send + Sync,
Create an endpoint which do something with the output value from self
.
fn map_async<F, T>(self, f: F) -> MapAsync<Self, F> where
F: FnOnce(Self::Output) -> T + Clone + Send + Sync,
T: IntoTask,
T::Task: Send,
F: FnOnce(Self::Output) -> T + Clone + Send + Sync,
T: IntoTask,
T::Task: Send,
Create an endpoint which continue an asynchronous computation
from the value returned from self
.
Implementors
impl<E: Endpoint> EndpointExt for E