Skip to main content

CanvasPersistenceCodec

Trait CanvasPersistenceCodec 

Source
pub trait CanvasPersistenceCodec {
    type Error: Debug + Display;

    // Required methods
    fn encode_checkpoint(
        &self,
        checkpoint: &CanvasCheckpoint,
    ) -> Result<Vec<u8>, Self::Error>;
    fn decode_checkpoint(
        &self,
        bytes: &[u8],
    ) -> Result<CanvasCheckpoint, Self::Error>;
    fn encode_log_entry(
        &self,
        entry: &CanvasLogEntry,
    ) -> Result<Vec<u8>, Self::Error>;
    fn decode_log_entry(
        &self,
        bytes: &[u8],
    ) -> Result<CanvasLogEntry, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn encode_checkpoint( &self, checkpoint: &CanvasCheckpoint, ) -> Result<Vec<u8>, Self::Error>

Source

fn decode_checkpoint( &self, bytes: &[u8], ) -> Result<CanvasCheckpoint, Self::Error>

Source

fn encode_log_entry( &self, entry: &CanvasLogEntry, ) -> Result<Vec<u8>, Self::Error>

Source

fn decode_log_entry(&self, bytes: &[u8]) -> Result<CanvasLogEntry, Self::Error>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§