Struct bytecodec::bytes::Utf8Decoder[][src]

pub struct Utf8Decoder<D = RemainingBytesDecoder>(_);

Utf8Decoder decodes Rust strings from a input byte sequence.

Examples

use bytecodec::{Decode, Eos};
use bytecodec::bytes::Utf8Decoder;

let mut decoder = Utf8Decoder::new();

decoder.decode(b"foo", Eos::new(true)).unwrap();
assert_eq!(decoder.finish_decoding().unwrap(), "foo");

Methods

impl Utf8Decoder<RemainingBytesDecoder>
[src]

Makes a new Utf8Decoder that uses RemainingBytesDecoder as the internal bytes decoder.

impl<D> Utf8Decoder<D> where
    D: Decode<Item = Vec<u8>>, 
[src]

Makes a new Utf8Decoder with the given bytes decoder.

Important traits for &'a mut R

Returns a reference to the inner bytes decoder.

Important traits for &'a mut R

Returns a mutable reference to the inner bytes decoder.

Takes ownership of this instance and returns the inner bytes decoder.

Trait Implementations

impl<D: Debug> Debug for Utf8Decoder<D>
[src]

Formats the value using the given formatter. Read more

impl<D: Default> Default for Utf8Decoder<D>
[src]

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

impl<D> Decode for Utf8Decoder<D> where
    D: Decode<Item = Vec<u8>>, 
[src]

The type of items to be decoded.

Consumes the given buffer (a part of a byte sequence), and proceeds the decoding process. Read more

Finishes the current decoding process and returns the decoded item. Read more

Returns the lower bound of the number of bytes needed to decode the next item. Read more

Returns true if there are no items to be decoded by the decoder at the next invocation of decode method, otherwise false. Read more

Auto Trait Implementations

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

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