Skip to main content

BlockIO

Trait BlockIO 

Source
pub trait BlockIO {
    // Required methods
    fn read_block(
        &self,
        tier: Tier,
        key: BlockKey,
        dst: &mut [u8],
    ) -> Result<usize, StoreError>;
    fn write_block(
        &mut self,
        tier: Tier,
        key: BlockKey,
        src: &[u8],
    ) -> Result<(), StoreError>;
    fn delete_block(
        &mut self,
        tier: Tier,
        key: BlockKey,
    ) -> Result<(), StoreError>;
}
Expand description

Block I/O for reading and writing raw quantized data.

Required Methods§

Source

fn read_block( &self, tier: Tier, key: BlockKey, dst: &mut [u8], ) -> Result<usize, StoreError>

Read quantized bytes for key from the given tier into dst. Returns the number of bytes written to dst.

Source

fn write_block( &mut self, tier: Tier, key: BlockKey, src: &[u8], ) -> Result<(), StoreError>

Write raw quantized bytes src for key into the given tier.

Source

fn delete_block(&mut self, tier: Tier, key: BlockKey) -> Result<(), StoreError>

Delete the raw data for key from the given tier.

Implementors§