Decoder

Trait Decoder 

Source
pub trait Decoder: Iterator<Item = char> {
    // Required methods
    fn next_n(&mut self, n: usize) -> Vec<char>;
    fn fill_n(&mut self, n: usize, target: &mut [char]) -> usize;
}
Expand description

Provide a common interface for stream decoders.

Required Methods§

Source

fn next_n(&mut self, n: usize) -> Vec<char>

Fetch a sequence of characters. The returned array will have the number of characters requested, or fewer if the end of the stream is encountered.

Source

fn fill_n(&mut self, n: usize, target: &mut [char]) -> usize

Given a mutable array start filling it from position zero and fill up to the specified number of characters. The actual number of characters filled (which may be less than requested) is returned.

Implementors§