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§
Sourcefn consume(self) -> Result<T>
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.
Sourcefn consume_partial(self) -> Option<T>
fn consume_partial(self) -> Option<T>
Consumes the iterator partially to create an instance of T.