sakka 0.0.1

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

/// A trait for types that can be encoded into a `Writer`.
pub trait Encode<Ctx = ()> {
    /// Encodes a value of this type into the given writer.
    fn encode(&self, w: &mut Writer<Ctx>) -> Result<(), Error>;
}