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>; }