sakka 0.0.9

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

/// A trait for types that can be encoded into a `Writer`.
pub trait Encode<Ctx = ()>
where
    Self::Error: From<Error>,
{
    type Error;

    /// Encodes a value of this type into the given writer.
    fn encode(&self, w: &mut Writer<Ctx>) -> Result<(), Self::Error>;
}