store_api::manifest

Trait Checkpoint

source
pub trait Checkpoint:
    Send
    + Sync
    + Clone
    + Debug {
    type Error: ErrorExt + Send + Sync;

    // Required methods
    fn set_protocol(&mut self, action: ProtocolAction);
    fn last_version(&self) -> ManifestVersion;
    fn encode(&self) -> Result<Vec<u8>, Self::Error>;
    fn decode(
        bs: &[u8],
        reader_version: ProtocolVersion,
    ) -> Result<Self, Self::Error>;
}
Expand description

The checkpoint by checkpoint

Required Associated Types§

source

type Error: ErrorExt + Send + Sync

Required Methods§

source

fn set_protocol(&mut self, action: ProtocolAction)

Set a protocol action into checkpoint

source

fn last_version(&self) -> ManifestVersion

The last compacted action’s version of checkpoint

source

fn encode(&self) -> Result<Vec<u8>, Self::Error>

Encode this checkpoint into a byte vector

source

fn decode( bs: &[u8], reader_version: ProtocolVersion, ) -> Result<Self, Self::Error>

Decode self from byte slice with reader protocol version, return error when reader version is not supported.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§