Trait ExtractFuture

Source
pub trait ExtractFuture {
    type Item;

    // Required methods
    fn poll(&mut self) -> Poll<(), Error>;
    fn extract(self) -> Self::Item;
}
Expand description

Future representing the completion of extracting a value from a request

Implementations are expected to advance to a state where extract will succeed. This is done by performing any asynchronous processing when poll is called and usually stashing the extracted value internally until extract is called.

extract must not be called until poll returns Ok(Ready(())).

Required Associated Types§

Source

type Item

The argument extracted from the request.

Required Methods§

Source

fn poll(&mut self) -> Poll<(), Error>

Returns Ok(Ready(())) when extract() can be called. If NotReady is returned, the current task is registered for wakeup.

Source

fn extract(self) -> Self::Item

Consume self and return the value extracted from the HTTP request.

Implementors§