sakka 0.0.4

A low-level framework for implementing binary file format parsers and writers.
Documentation
1
2
3
4
5
6
7
use crate::{Error, Reader};

/// A trait for types that can be decoded from a `Reader`.
pub trait Decode<Ctx = ()>: Sized {
    /// Decodes a value of this type from the given reader.
    fn decode(r: &mut Reader<'_, Ctx>) -> Result<Self, Error>;
}