pub trait Codec64: Sized + 'static {
    fn codec_name() -> String;
    fn encode(&self) -> [u8; 8];
    fn decode(buf: [u8; 8]) -> Self;
}
Expand description

Encoding and decoding operations for a type usable as a persisted timestamp or diff.

Required Methods§

Name of the codec.

This name is stored for the timestamp and diff when a stream is first created and the same timestamp and diff codec must be used for that stream afterward.

Encode a timestamp or diff for permanent storage.

This must perfectly round-trip Self through Codec64::decode. If the encode function for this codec ever changes, decode must be able to handle bytes output by all previous versions of encode.

Decode a timestamp or diff previous encoded with this codec’s Codec64::encode.

This must perfectly round-trip Self through Codec64::encode. If the encode function for this codec ever changes, decode must be able to handle bytes output by all previous versions of encode.

Implementations on Foreign Types§

Implementors§