pub trait EndpointExt: Endpoint + Sized {
// Provided methods
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 { ... }
}Expand description
A set of extension methods used for composing complicate endpoints.
Provided Methods§
Sourcefn as_t<T>(self) -> Selfwhere
Self: Endpoint<Output = T>,
fn as_t<T>(self) -> Selfwhere
Self: Endpoint<Output = T>,
Annotate that the associated type Output is equal to T.
Sourcefn and<E>(self, e: E) -> And<Self, E::Endpoint>
fn and<E>(self, e: E) -> And<Self, E::Endpoint>
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.
Sourcefn left<E>(self, e: E) -> Left<Self, E::Endpoint>where
E: IntoEndpoint,
fn left<E>(self, e: E) -> Left<Self, E::Endpoint>where
E: IntoEndpoint,
Create an endpoint which evaluates self and e and returns the task of self if matched.
Sourcefn right<E>(self, e: E) -> Right<Self, E::Endpoint>where
E: IntoEndpoint,
fn right<E>(self, e: E) -> Right<Self, E::Endpoint>where
E: IntoEndpoint,
Create an endpoint which evaluates self and e and returns the task of e if matched.
Sourcefn or<E>(self, e: E) -> Or<Self, E::Endpoint>where
E: IntoEndpoint<Output = Self::Output>,
fn or<E>(self, e: E) -> Or<Self, E::Endpoint>where
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.
Sourcefn lift(self) -> Lift<Self>
fn lift(self) -> Lift<Self>
Create an endpoint which returns None if the inner endpoint skips the request.
Sourcefn map<F, U>(self, f: F) -> Map<Self, F>
fn map<F, U>(self, f: F) -> Map<Self, F>
Create an endpoint which maps the returned value to a different type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.