pub trait Encode<C: Codec> {
    fn encode<W: Write>(&self, c: C, w: &mut W) -> Result<()>;
}
Expand description

Encode trait.

This trait is generic over a codec, so that different codecs can be implemented for the same type.

Required Methods§

Encodes into a impl Write.

It takes a specific codec as parameter, so that the Encode can be generic over an enum that contains multiple codecs.

Implementations on Foreign Types§

Implementors§