Trait finchers::Endpoint [] [src]

pub trait Endpoint {
    type Item;
    type Error;
    type Future: Future<Item = Self::Item, Error = Self::Error>;
    fn apply(self, ctx: &mut Context) -> EndpointResult<Self::Future>;

    fn join<E>(self, e: E) -> (Self, E)
    where
        Self: Sized,
        E: Endpoint<Error = Self::Error>
, { ... }
fn join3<E1, E2>(self, e1: E1, e2: E2) -> (Self, E1, E2)
    where
        Self: Sized,
        E1: Endpoint<Error = Self::Error>,
        E2: Endpoint<Error = Self::Error>
, { ... }
fn join4<E1, E2, E3>(self, e1: E1, e2: E2, e3: E3) -> (Self, E1, E2, E3)
    where
        Self: Sized,
        E1: Endpoint<Error = Self::Error>,
        E2: Endpoint<Error = Self::Error>,
        E3: Endpoint<Error = Self::Error>
, { ... }
fn join5<E1, E2, E3, E4>(
        self,
        e1: E1,
        e2: E2,
        e3: E3,
        e4: E4
    ) -> (Self, E1, E2, E3, E4)
    where
        Self: Sized,
        E1: Endpoint<Error = Self::Error>,
        E2: Endpoint<Error = Self::Error>,
        E3: Endpoint<Error = Self::Error>,
        E4: Endpoint<Error = Self::Error>
, { ... }
fn with<E>(self, e: E) -> With<Self, E>
    where
        Self: Sized,
        E: Endpoint
, { ... }
fn skip<E>(self, e: E) -> Skip<Self, E>
    where
        Self: Sized,
        E: Endpoint
, { ... }
fn or<E>(self, e: E) -> Or<Self, E>
    where
        Self: Sized,
        E: Endpoint<Item = Self::Item, Error = Self::Error>
, { ... }
fn map<F, U>(self, f: F) -> Map<Self, F>
    where
        Self: Sized,
        F: FnOnce(Self::Item) -> U
, { ... }
fn map_err<F, U>(self, f: F) -> MapErr<Self, F>
    where
        Self: Sized,
        F: FnOnce(Self::Error) -> U
, { ... }
fn and_then<F, Fut>(self, f: F) -> AndThen<Self, F>
    where
        Self: Sized,
        F: FnOnce(Self::Item) -> Fut,
        Fut: IntoFuture<Error = Self::Error>
, { ... }
fn or_else<F, Fut>(self, f: F) -> OrElse<Self, F>
    where
        Self: Sized,
        F: FnOnce(Self::Error) -> Fut,
        Fut: IntoFuture<Item = Self::Item>
, { ... }
fn then<F, Fut>(self, f: F) -> Then<Self, F>
    where
        Self: Sized,
        F: FnOnce(Result<Self::Item, Self::Error>) -> Fut,
        Fut: IntoFuture
, { ... }
fn from_err<T>(self) -> FromErr<Self, T>
    where
        Self: Sized,
        T: From<Self::Error>
, { ... }
fn inspect<F>(self, f: F) -> Inspect<Self, F>
    where
        Self: Sized,
        F: FnOnce(&Self::Item)
, { ... } }

A HTTP endpoint, which provides the futures from incoming HTTP requests

Associated Types

The type of resolved value, created by this endpoint

The type of future created by this endpoint

Required Methods

Apply the incoming HTTP request, and return the future of its response

Provided Methods

Combine itself and the other endpoint, and create a combinator which returns a pair of its Items.

Combine itself and two other endpoints, and create a combinator which returns a tuple of its Items.

Combine itself and three other endpoints, and create a combinator which returns a tuple of its Items.

Combine itself and four other endpoints, and create a combinator which returns a tuple of its Items.

Combine itself and the other endpoint, and create a combinator which returns E::Item.

Combine itself and the other endpoint, and create a combinator which returns Self::Item.

Create an endpoint which attempts to apply self. If self failes, then revert the context and retry applying e.

Combine itself and a function to change the return value to another type.

Combine itself and a function to change the error value to another type.

Implementors