Skip to main content

SSTableValue

Trait SSTableValue 

Source
pub trait SSTableValue:
    Clone
    + Send
    + Sync {
    // Required methods
    fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>;
    fn deserialize<R: Read>(reader: &mut R) -> Result<Self>;
}
Expand description

A value that can be stored in an SSTableWriter and read by an AsyncSSTableReader.

Implementations form part of the on-disk format. deserialize must consume exactly the bytes written by one serialize call so the block decoder can continue at the following entry.

Required Methods§

Source

fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>

Append this value’s binary representation to writer.

Source

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Read one value from reader, leaving subsequent entry bytes untouched.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl SSTableValue for Vec<u8>

Vec<u8> value implementation

Source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl SSTableValue for u64

u64 value implementation

Source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>

Source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Implementors§