[−][src]Struct tower_web::extract::Immediate
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.
fn poll(&mut self) -> Poll<(), Error>
[src]
fn extract(self) -> T
[src]
impl<T, E> From<Result<T, E>> for Immediate<T> where
E: Into<Error>,
[src]
E: Into<Error>,
impl<T: Debug> Debug for Immediate<T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self