barse 0.3.0

Binary parsing library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::ByteRead;

/// Trait for types that can be read from a byte reader provided some extra information is passed.
pub trait FromByteReaderWith<'input, W>: Sized {
    /// Error type returned when parsing fails.
    type Err;
    /// Read Self from a [`ByteRead`] and some other value.
    ///
    /// # Errors
    /// If the implementor needs to.
    fn from_byte_reader_with<R>(reader: R, with: W) -> Result<Self, Self::Err>
    where
        R: ByteRead<'input>;
}