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]
pub fn new(inner: E) -> Self
[src]
Makes a new NoBodyEncoder
instance.
pub fn inner_ref(&self) -> &E
[src]
Returns a reference to a inner body encoder.
pub fn inner_mut(&mut self) -> &mut E
[src]
Returns a mutable reference to a inner body encoder.
pub fn into_inner(self) -> E
[src]
Takes ownership of NoBodyEncoder
and returns the inner body encoder.
Trait Implementations
impl<E: Debug> Debug for NoBodyEncoder<E>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<E: Default> Default for NoBodyEncoder<E>
[src]
fn default() -> NoBodyEncoder<E>
[src]
Returns the "default value" for a type. Read more
impl<E: BodyEncode> Encode for NoBodyEncoder<E>
[src]
type Item = E::Item
The type of items to be encoded.
fn encode(&mut self, _buf: &mut [u8], _eos: Eos) -> Result<usize>
[src]
Encodes the items in the encoder and writes the encoded bytes to the given buffer. Read more
fn start_encoding(&mut self, item: Self::Item) -> Result<()>
[src]
Tries to start encoding the given item. Read more
fn is_idle(&self) -> bool
[src]
Returns true
if there are no items to be encoded in the encoder, otherwise false
.
fn requiring_bytes(&self) -> ByteCount
[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]
fn exact_requiring_bytes(&self) -> u64
[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]
Auto Trait Implementations
impl<E> Send for NoBodyEncoder<E> where
E: Send,
E: Send,
impl<E> Sync for NoBodyEncoder<E> where
E: Sync,
E: Sync,