Enum rocket::http::hyper::h1::HttpReader[][src]

pub enum HttpReader<R> {
    SizedReader(R, u64),
    ChunkedReader(R, Option<u64>),
    EofReader(R),
    EmptyReader(R),
}

Readers to handle different Transfer-Encodings.

If a message body does not include a Transfer-Encoding, it should include a Content-Length header.

Variants

SizedReader(R, u64)

A Reader used when a Content-Length header is passed with a positive integer.

ChunkedReader(R, Option<u64>)

A Reader used when Transfer-Encoding is chunked.

EofReader(R)

A Reader used for responses that don't indicate a length or chunked.

Note: This should only used for Responses. It is illegal for a Request to be made with both Content-Length and Transfer-Encoding: chunked missing, as explained from the spec:

If a Transfer-Encoding header field is present in a response and the chunked transfer coding is not the final encoding, the message body length is determined by reading the connection until it is closed by the server. If a Transfer-Encoding header field is present in a request and the chunked transfer coding is not the final encoding, the message body length cannot be determined reliably; the server MUST respond with the 400 (Bad Request) status code and then close the connection.

EmptyReader(R)

A Reader used for messages that should never have a body.

See https://tools.ietf.org/html/rfc7230#section-3.3.3

Implementations

impl<R> HttpReader<R> where
    R: Read
[src]

pub fn into_inner(self) -> R[src]

Unwraps this HttpReader and returns the underlying Reader.

pub fn get_ref(&self) -> &R[src]

Gets a borrowed reference to the underlying Reader.

pub fn get_mut(&mut self) -> &mut R[src]

Gets a mutable reference to the underlying Reader.

Trait Implementations

impl<R> Debug for HttpReader<R>[src]

impl<R> Read for HttpReader<R> where
    R: Read
[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for HttpReader<R> where
    R: RefUnwindSafe
[src]

impl<R> Send for HttpReader<R> where
    R: Send
[src]

impl<R> Sync for HttpReader<R> where
    R: Sync
[src]

impl<R> Unpin for HttpReader<R> where
    R: Unpin
[src]

impl<R> UnwindSafe for HttpReader<R> where
    R: UnwindSafe
[src]

Blanket Implementations

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

impl<T, I> AsResult<T, I> for T where
    I: Input
[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, U> Into<U> for T where
    U: From<T>, 
[src]

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

impl<R> ReadBytesExt for R where
    R: Read + ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

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> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,