Trait finchers::endpoint::Endpoint [−][src]
pub trait Endpoint<'a>: 'a { type Output: Tuple; type Future: Future<Item = Self::Output, Error = Error> + 'a; fn apply(&'a self, ecx: &mut ApplyContext) -> ApplyResult<Self::Future>; fn with_output<T: Tuple>(self) -> Self
where
Self: Endpoint<'a, Output = T> + Sized, { ... } fn wrap<W>(self, wrapper: W) -> W::Endpoint
where
Self: Sized,
W: Wrapper<'a, Self>, { ... } }
Trait representing an endpoint.
Associated Types
type Output: Tuple
The inner type associated with this endpoint.
type Future: Future<Item = Self::Output, Error = Error> + 'a
The type of value which will be returned from apply
.
Required Methods
fn apply(&'a self, ecx: &mut ApplyContext) -> ApplyResult<Self::Future>
Perform checking the incoming HTTP request and returns an instance of the associated Future if matched.
Provided Methods
fn with_output<T: Tuple>(self) -> Self where
Self: Endpoint<'a, Output = T> + Sized,
Self: Endpoint<'a, Output = T> + Sized,
Add an annotation that the associated type Output
is fixed to T
.
fn wrap<W>(self, wrapper: W) -> W::Endpoint where
Self: Sized,
W: Wrapper<'a, Self>,
Self: Sized,
W: Wrapper<'a, Self>,
Converts self
using the provided Wrapper
.
Implementations on Foreign Types
impl<'a, E: Endpoint<'a>> Endpoint<'a> for Box<E>
[src]
impl<'a, E: Endpoint<'a>> Endpoint<'a> for Box<E>
type Output = E::Output
type Future = E::Future
fn apply(&'a self, ecx: &mut ApplyContext) -> ApplyResult<Self::Future>
[src]
fn apply(&'a self, ecx: &mut ApplyContext) -> ApplyResult<Self::Future>
fn with_output<T: Tuple>(self) -> Self where
Self: Endpoint<'a, Output = T> + Sized,
[src]
fn with_output<T: Tuple>(self) -> Self where
Self: Endpoint<'a, Output = T> + Sized,
fn wrap<W>(self, wrapper: W) -> W::Endpoint where
Self: Sized,
W: Wrapper<'a, Self>,
[src]
fn wrap<W>(self, wrapper: W) -> W::Endpoint where
Self: Sized,
W: Wrapper<'a, Self>,
impl<'a, E: Endpoint<'a>> Endpoint<'a> for Rc<E>
[src]
impl<'a, E: Endpoint<'a>> Endpoint<'a> for Rc<E>
type Output = E::Output
type Future = E::Future
fn apply(&'a self, ecx: &mut ApplyContext) -> ApplyResult<Self::Future>
[src]
fn apply(&'a self, ecx: &mut ApplyContext) -> ApplyResult<Self::Future>
fn with_output<T: Tuple>(self) -> Self where
Self: Endpoint<'a, Output = T> + Sized,
[src]
fn with_output<T: Tuple>(self) -> Self where
Self: Endpoint<'a, Output = T> + Sized,
fn wrap<W>(self, wrapper: W) -> W::Endpoint where
Self: Sized,
W: Wrapper<'a, Self>,
[src]
fn wrap<W>(self, wrapper: W) -> W::Endpoint where
Self: Sized,
W: Wrapper<'a, Self>,
impl<'a, E: Endpoint<'a>> Endpoint<'a> for Arc<E>
[src]
impl<'a, E: Endpoint<'a>> Endpoint<'a> for Arc<E>
type Output = E::Output
type Future = E::Future
fn apply(&'a self, ecx: &mut ApplyContext) -> ApplyResult<Self::Future>
[src]
fn apply(&'a self, ecx: &mut ApplyContext) -> ApplyResult<Self::Future>
fn with_output<T: Tuple>(self) -> Self where
Self: Endpoint<'a, Output = T> + Sized,
[src]
fn with_output<T: Tuple>(self) -> Self where
Self: Endpoint<'a, Output = T> + Sized,
fn wrap<W>(self, wrapper: W) -> W::Endpoint where
Self: Sized,
W: Wrapper<'a, Self>,
[src]
fn wrap<W>(self, wrapper: W) -> W::Endpoint where
Self: Sized,
W: Wrapper<'a, Self>,
Implementors
impl<'e, T: Tuple + 'static> Endpoint<'e> for EndpointObj<T> type Output = T; type Future = Box<Future<Item = Self::Output, Error = Error> + Send + 'e>;
impl<'e, T: Tuple + 'static> Endpoint<'e> for LocalEndpointObj<T> type Output = T; type Future = Box<Future<Item = Self::Output, Error = Error> + 'e>;
impl<'a> Endpoint<'a> for MatchVerbs type Output = (); type Future = Matched;
impl<'e> Endpoint<'e> for MatchVerbGet type Output = (); type Future = Matched;
impl<'e> Endpoint<'e> for MatchVerbPost type Output = (); type Future = Matched;
impl<'e> Endpoint<'e> for MatchVerbPut type Output = (); type Future = Matched;
impl<'e> Endpoint<'e> for MatchVerbDelete type Output = (); type Future = Matched;
impl<'e> Endpoint<'e> for MatchVerbHead type Output = (); type Future = Matched;
impl<'e> Endpoint<'e> for MatchVerbOptions type Output = (); type Future = Matched;
impl<'e> Endpoint<'e> for MatchVerbConnect type Output = (); type Future = Matched;
impl<'e> Endpoint<'e> for MatchVerbPatch type Output = (); type Future = Matched;
impl<'e> Endpoint<'e> for MatchVerbTrace type Output = (); type Future = Matched;
impl<'a> Endpoint<'a> for MatchSegment type Output = (); type Future = Matched;
impl<'a> Endpoint<'a> for MatchEos type Output = (); type Future = Matched;
impl<'a, T> Endpoint<'a> for Param<T> where
T: FromEncodedStr, type Output = (T,); type Future = Extracted<T>;impl<'a, T> Endpoint<'a> for Remains<T> where
T: FromEncodedStr, type Output = (T,); type Future = Extracted<T>;impl<'a, E1, E2> Endpoint<'a> for And<E1, E2> where
E1: Endpoint<'a>,
E2: Endpoint<'a>,
E1::Output: Combine<E2::Output>, type Output = <E1::Output as Combine<E2::Output>>::Out; type Future = AndFuture<E1::Future, E2::Future>;impl<'a, F, R> Endpoint<'a> for Apply<F> where
F: Fn(&mut ApplyContext) -> ApplyResult<R> + 'a,
R: IntoFuture<Error = Error> + 'a, type Output = (R::Item,); type Future = ApplyFuture<R::Future>;impl<'a, F, R> Endpoint<'a> for ApplyRaw<F> where
F: Fn(&mut ApplyContext) -> ApplyResult<R> + 'a,
R: IntoFuture<Error = Error> + 'a,
R::Item: Tuple, type Output = R::Item; type Future = R::Future;impl<'a, T: 'a> Endpoint<'a> for ByRef<T> type Output = (&'a T,); type Future = ByRefFuture<'a, T>;
impl<'a, T: Clone + 'a> Endpoint<'a> for Cloned<T> type Output = (T,); type Future = ClonedFuture<T>;
impl<'a, F, R> Endpoint<'a> for Lazy<F> where
F: Fn() -> R + 'a,
R: IntoFuture<Error = Error> + 'a, type Output = (R::Item,); type Future = LazyFuture<R::Future>;impl<'a, E1, E2> Endpoint<'a> for Or<E1, E2> where
E1: Endpoint<'a>,
E2: Endpoint<'a>, type Output = (Wrapped<E1::Output, E2::Output>,); type Future = OrFuture<E1::Future, E2::Future>;impl<'a, E1, E2> Endpoint<'a> for OrStrict<E1, E2> where
E1: Endpoint<'a>,
E2: Endpoint<'a, Output = E1::Output>, type Output = E1::Output; type Future = OrStrictFuture<E1::Future, E2::Future>;impl<'a> Endpoint<'a> for Unit type Output = (); type Future = UnitFuture;
impl<'e> Endpoint<'e> for finchers::endpoints::body::Raw type Output = (Payload,); type Future = RawFuture;
impl<'a> Endpoint<'a> for ReceiveAll type Output = (Bytes,); type Future = ReceiveAllFuture;
impl<'a> Endpoint<'a> for Text type Output = (String,); type Future = ParseFuture<String>;
impl<'e, T> Endpoint<'e> for Json<T> where
T: DeserializeOwned + 'static, type Output = (T,); type Future = Map<ParseFuture<Json<T>>, fn(_: (Json<T>,)) -> (T,)>;impl<'e, T> Endpoint<'e> for UrlEncoded<T> where
T: DeserializeOwned + 'static, type Output = (T,); type Future = Map<ParseFuture<UrlEncoded<T>>, fn(_: (UrlEncoded<T>,)) -> (T,)>;impl<'a> Endpoint<'a> for finchers::endpoints::cookie::Required type Output = (Cookie<'static>,); type Future = FutureResult<Self::Output, Error>;
impl<'a> Endpoint<'a> for finchers::endpoints::cookie::Optional type Output = (Option<Cookie<'static>>,); type Future = FutureResult<Self::Output, Error>;
impl<'a> Endpoint<'a> for File type Output = (NamedFile,); type Future = FileFuture;
impl<'a> Endpoint<'a> for Dir type Output = (NamedFile,); type Future = FileFuture;
impl<'e, T> Endpoint<'e> for Parse<T> where
T: FromHeaderValue, type Output = (T,); type Future = ParseFuture<'e, T>;impl<'e, T> Endpoint<'e> for finchers::endpoints::header::Optional<T> where
T: FromHeaderValue, type Output = (Option<T>,); type Future = OptionalFuture<'e, T>;impl<'e, V> Endpoint<'e> for Matches<V> where
V: PartialEq<HeaderValue> + 'e, type Output = (); type Future = FutureResult<Self::Output, Error>;impl<'a> Endpoint<'a> for finchers::endpoints::header::Raw type Output = (Option<HeaderValue>,); type Future = FutureResult<Self::Output, Error>;
impl<'a, T> Endpoint<'a> for finchers::endpoints::query::Required<T> where
T: DeserializeOwned + 'static, type Output = (T,); type Future = RequiredFuture<T>;impl<'a, T> Endpoint<'a> for finchers::endpoints::query::Optional<T> where
T: DeserializeOwned + 'static, type Output = (Option<T>,); type Future = OptionalFuture<T>;impl<'a> Endpoint<'a> for finchers::endpoints::query::Raw type Output = (Option<String>,); type Future = RawFuture;