[][src]Struct httpcodec::BodyDecoder

pub struct BodyDecoder<D: Decode>(_);

Basic HTTP body decoder.

It is typically used for making a body decoder from a Decode implementor.

Methods

impl<D: Decode> BodyDecoder<D>[src]

pub fn new(inner: D) -> Self[src]

Makes a new BodyDecoder instance.

Trait Implementations

impl<D: Decode> BodyDecode for BodyDecoder<D>[src]

impl<D: Default + Decode> Default for BodyDecoder<D>[src]

impl<D: Debug + Decode> Debug for BodyDecoder<D>[src]

impl<D: Decode> Decode for BodyDecoder<D>[src]

type Item = D::Item

The type of items to be decoded.

Auto Trait Implementations

impl<D> Unpin for BodyDecoder<D> where
    D: Unpin

impl<D> Send for BodyDecoder<D> where
    D: Send

impl<D> Sync for BodyDecoder<D> where
    D: Sync

impl<D> RefUnwindSafe for BodyDecoder<D> where
    D: RefUnwindSafe

impl<D> UnwindSafe for BodyDecoder<D> where
    D: UnwindSafe

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