Trait kv::Encoding

source ·
pub trait Encoding: Sized {
    fn encode_to<W: Write>(&self, w: &mut W) -> Result<(), Error>;
    fn decode_from<R: Read>(r: &mut R) -> Result<Self, Error>;

    fn encode(&self) -> Result<ValueBuf<Self>, Error> { ... }
    fn decode<'a, V: Value<'a>>(val: &'a V) -> Result<Self, Error> { ... }
}
Expand description

Encoded values

Required Methods§

Encode an object to io::Write

Decode from a reader

Provided Methods§

Encode an object to ValueBuf

Decode from an existing value

Implementors§