[][src]Struct httpcodec::NoBodyDecoder

pub struct NoBodyDecoder;

A body decoder that consumes no bytes.

This does consume no bytes and immediately returns () as the decoded item.

It is mainly intended to be used for decoding HEAD responses. It can also be used to prefetch the HTTP header before decoding the body of a HTTP message.

Trait Implementations

impl BodyDecode for NoBodyDecoder[src]

fn initialize(&mut self, header: &Header) -> Result<()>[src]

This method is called before starting to decode a HTTP body. Read more

impl Default for NoBodyDecoder[src]

impl Debug for NoBodyDecoder[src]

impl Decode for NoBodyDecoder[src]

type Item = ()

The type of items to be decoded.

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[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<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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> IoDecodeExt for T where
    T: Decode
[src]

fn decode_from_read_buf<B>(&mut self, buf: &mut ReadBuf<B>) -> Result<(), Error> where
    B: AsRef<[u8]>, 
[src]

Consumes bytes from the given read buffer and proceeds the decoding process.

fn decode_exact<R>(&mut self, reader: R) -> Result<Self::Item, Error> where
    R: Read
[src]

Decodes an item from the given reader. Read more

impl<T> DecodeExt for T where
    T: Decode
[src]

fn map<T, F>(self, f: F) -> Map<Self, T, F> where
    F: Fn(Self::Item) -> T, 
[src]

Creates a decoder that converts decoded values by calling the given function. Read more

fn try_map<T, E, F>(self, f: F) -> TryMap<Self, T, E, F> where
    F: Fn(Self::Item) -> Result<T, E>,
    Error: From<E>, 
[src]

Creates a decoder that tries to convert decoded values by calling the given function. Read more

fn map_err<E, F>(self, f: F) -> MapErr<Self, E, F> where
    F: Fn(Error) -> E,
    Error: From<E>, 
[src]

Creates a decoder for modifying decoding errors produced by self. Read more

fn and_then<D, F>(self, f: F) -> AndThen<Self, D, F> where
    D: Decode,
    F: Fn(Self::Item) -> D, 
[src]

Creates a decoder that enables conditional decoding. Read more

fn collect<T>(self) -> Collect<Self, T> where
    T: Extend<Self::Item> + Default
[src]

Creates a decoder for collecting decoded items. Read more

fn collectn<T>(self, n: usize) -> CollectN<Self, T> where
    T: Extend<Self::Item> + Default
[src]

Creates a decoder that decodes n items by using self and collecting the result. Read more

fn length(self, expected_bytes: u64) -> Length<Self>[src]

Creates a decoder that consumes the specified number of bytes exactly. Read more

fn omit(self, do_omit: bool) -> Omittable<Self>[src]

Creates a decoder that will omit decoding items if do_omit = true is specified. Read more

fn max_bytes(self, bytes: u64) -> MaxBytes<Self>[src]

Creates a decoder that will fail if the number of consumed bytes exceeds bytes. Read more

fn chain<T>(self, other: T) -> TupleDecoder<(Self, T)> where
    T: Decode
[src]

Takes two decoders and creates a new decoder that decodes both items in sequence. Read more

fn slice(self) -> Slice<Self>[src]

Creates a decoder that makes it possible to slice the input byte sequence in arbitrary units. Read more

fn peekable(self) -> Peekable<Self>[src]

Creates a decoder that enables to peek decoded items before calling finish_decoding method. Read more

fn maybe_eos(self) -> MaybeEos<Self>[src]

Creates a decoder that ignores EOS if there is no item being decoded. Read more

fn decode_from_bytes(&mut self, buf: &[u8]) -> Result<Self::Item, Error>[src]

Decodes an item by consuming the whole part of the given bytes. Read more