[][src]Struct surf::middleware::Next

pub struct Next<'a, C: HttpClient> { /* fields omitted */ }

The remainder of a middleware chain, including the endpoint.

Methods

impl<'a, C: HttpClient> Next<'a, C>[src]

pub fn new(
    next: &'a [Arc<dyn Middleware<C>>],
    endpoint: &'a (dyn Fn(Request, C) -> BoxFuture<'static, Result<Response, Exception>> + Send + Sync + 'static)
) -> Self
[src]

Create a new instance

pub fn run(
    self,
    req: Request,
    client: C
) -> BoxFuture<'a, Result<Response, Exception>>
[src]

Asynchronously execute the remaining middleware chain.

Trait Implementations

impl<'_, C: HttpClient> Clone for Next<'_, C>[src]

impl<'_, C: HttpClient> Copy for Next<'_, C>[src]

Auto Trait Implementations

impl<'a, C> Send for Next<'a, C>

impl<'a, C> Sync for Next<'a, C>

impl<'a, C> Unpin for Next<'a, C>

impl<'a, C> !UnwindSafe for Next<'a, C>

impl<'a, C> !RefUnwindSafe for Next<'a, C>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]