[][src]Struct tower_web::extract::Immediate

pub struct Immediate<T> { /* fields omitted */ }

Implements ExtractFuture such that the result is immediately available.

This type is useful when implementing Extract for types that do not require any asynchronous processing. For example, extracting an HTTP header value from an HTTP request can complete immediately as all the information is present.

Methods

impl<T> Immediate<T>[src]

pub fn result(result: Result<T, Error>) -> Immediate<T>[src]

Create a new Immediate instance from a Result value.

When polling the returned Immediate instance, it will yield result.

pub fn ok(value: T) -> Immediate<T>[src]

Create a new Immediate instance that is in the success state.

When polling the returned Immediate instance, it will yield value.

pub fn err(error: Error) -> Immediate<T>[src]

Create a new Immediate instance that is in the error state.

When polling the returned Immediate instance, it will yield error.

Trait Implementations

impl<T> ExtractFuture for Immediate<T>[src]

type Item = T

The argument extracted from the request.

impl<T, E> From<Result<T, E>> for Immediate<T> where
    E: Into<Error>, 
[src]

impl<T: Debug> Debug for Immediate<T>[src]

Auto Trait Implementations

impl<T> Send for Immediate<T> where
    T: Send

impl<T> Sync for Immediate<T> where
    T: Sync

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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> Same for T

type Output = T

Should always be Self

impl<T> Erased for T