[][src]Struct httpbis::Response

pub struct Response(pub Pin<Box<dyn Future<Output = Result<(Headers, HttpStreamAfterHeaders)>> + Send>>);

Convenient wrapper around async HTTP response future/stream

Implementations

impl Response[src]

pub fn new<F>(future: F) -> Response where
    F: Future<Output = Result<(Headers, HttpStreamAfterHeaders)>> + Send + 'static, 
[src]

pub fn headers_and_stream(
    headers: Headers,
    stream: HttpStreamAfterHeaders
) -> Response
[src]

pub fn headers_and_bytes_stream<S>(headers: Headers, content: S) -> Response where
    S: Stream<Item = Result<Bytes>> + Send + 'static, 
[src]

pub fn headers(headers: Headers) -> Response[src]

Create a response with only headers

pub fn headers_and_bytes<B: Into<Bytes>>(
    header: Headers,
    content: B
) -> Response
[src]

Create a response with headers and response body

pub fn message(message: SimpleHttpMessage) -> Response[src]

pub fn found_200_plain_text(body: &str) -> Response[src]

pub fn not_found_404() -> Response[src]

pub fn redirect_302(location: &str) -> Response[src]

pub fn from_stream<S>(stream: S) -> Response where
    S: Stream<Item = Result<DataOrHeadersWithFlag>> + Unpin + Send + 'static, 
[src]

pub fn err(err: Error) -> Response[src]

pub fn into_stream_flag(
    self
) -> Pin<Box<dyn Stream<Item = Result<DataOrHeadersWithFlag>> + Send>>
[src]

pub fn into_stream(
    self
) -> Pin<Box<dyn Stream<Item = Result<DataOrHeaders>> + Send>>
[src]

pub fn into_part_stream(self) -> DataOrHeadersWithFlagStream[src]

pub fn collect(
    self
) -> Pin<Box<dyn Future<Output = Result<SimpleHttpMessage>> + Send>>
[src]

Trait Implementations

impl Future for Response[src]

type Output = Result<(Headers, HttpStreamAfterHeaders)>

The type of value produced on completion.

Auto Trait Implementations

impl !RefUnwindSafe for Response

impl Send for Response

impl !Sync for Response

impl Unpin for Response

impl !UnwindSafe for Response

Blanket Implementations

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

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

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

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

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]

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

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<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized
[src]

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.