Struct httpcodec::NoBodyEncoder [] [src]

pub struct NoBodyEncoder<E>(_);

A body encoder that produces no bytes.

NoBodyDecoder updates HTTP header ordinally but discards all data produced by the inner encoder.

It is mainly intended to be used for encoding HEAD responses.

Methods

impl<E: BodyEncode> NoBodyEncoder<E>
[src]

[src]

Makes a new NoBodyEncoder instance.

[src]

Returns a reference to a inner body encoder.

[src]

Returns a mutable reference to a inner body encoder.

[src]

Takes ownership of NoBodyEncoder and returns the inner body encoder.

Trait Implementations

impl<E: Debug> Debug for NoBodyEncoder<E>
[src]

[src]

Formats the value using the given formatter. Read more

impl<E: Default> Default for NoBodyEncoder<E>
[src]

[src]

Returns the "default value" for a type. Read more

impl<E: BodyEncode> Encode for NoBodyEncoder<E>
[src]

The type of items to be encoded.

[src]

Encodes the items in the encoder and writes the encoded bytes to the given buffer. Read more

[src]

Tries to start encoding the given item. Read more

[src]

Returns true if there are no items to be encoded in the encoder, otherwise false.

[src]

Returns the number of bytes required to encode all the items in the encoder. Read more

impl<E: BodyEncode> ExactBytesEncode for NoBodyEncoder<E>
[src]

[src]

Returns the exact number of bytes required to encode all the items remaining in the encoder.

impl<E: BodyEncode> BodyEncode for NoBodyEncoder<E>
[src]

[src]

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

Auto Trait Implementations

impl<E> Send for NoBodyEncoder<E> where
    E: Send

impl<E> Sync for NoBodyEncoder<E> where
    E: Sync