Skip to main content

Consume

Trait Consume 

Source
pub trait Consume<T> {
    // Required methods
    fn consume(self) -> Result<T>;
    fn consume_partial(self) -> Option<T>;
}
Expand description

Consumes a stream of bytes with little endianness to crate an object.

Required Methods§

Source

fn consume(self) -> Result<T>

Consumes the iterator to create an instance of T.

§Errors

Returns an [Error] if the stream terminates prematurely or contains excess bytes.

Source

fn consume_partial(self) -> Option<T>

Consumes the iterator partially to create an instance of T.

Implementors§

Source§

impl<T, I> Consume<T> for I
where T: FromLeStream, I: Iterator<Item = u8>,