StorageBackend

Trait StorageBackend 

Source
pub trait StorageBackend: Send + Sync {
    // Required methods
    fn read(&mut self, requests: &[ReadRequest], stream: u64) -> Result<()>;
    fn write_from_host(&mut self, key: GroupKey, src: &[u8]) -> Result<()>;
    fn group_layout(&self) -> GroupLayout;

    // Provided methods
    fn read_async(
        &mut self,
        requests: &[ReadRequest],
        stream: u64,
    ) -> Result<()> { ... }
    fn read_blocks(
        &mut self,
        requests: &[BlockReadRequest],
        stream: u64,
    ) -> Result<()> { ... }
    fn read_blocks_async(
        &mut self,
        requests: &[BlockReadRequest],
        stream: u64,
    ) -> Result<()> { ... }
    fn write_block_from_host(
        &mut self,
        base_key: GroupKey,
        src: &[u8],
    ) -> Result<()> { ... }
    fn write_blocks_run(
        &mut self,
        base_key: GroupKey,
        run_len: usize,
        src: &[u8],
    ) -> Result<()> { ... }
    fn supports_write_run_coalescing(&self) -> bool { ... }
    fn register_landing_region(&mut self, base: u64, len: usize) -> Result<()> { ... }
}

Required Methods§

Source

fn read(&mut self, requests: &[ReadRequest], stream: u64) -> Result<()>

2026-09-25: Fill every request’s destination. Returns once the data is in place, so work the caller enqueues on stream afterwards reads it.

Source

fn write_from_host(&mut self, key: GroupKey, src: &[u8]) -> Result<()>

2026-09-25: Write one group from host memory; src is group_bytes() long.

Source

fn group_layout(&self) -> GroupLayout

2026-09-25: The geometry the default block methods fan out with.

Provided Methods§

Source

fn read_async(&mut self, requests: &[ReadRequest], stream: u64) -> Result<()>

2026-09-25: Like read, but an implementation may return before the copies on stream finish. The default calls read.

Source

fn read_blocks( &mut self, requests: &[BlockReadRequest], stream: u64, ) -> Result<()>

2026-09-25: Read whole blocks, with the stream contract of read. The default fans out to read through expand_blocks_to_groups.

Source

fn read_blocks_async( &mut self, requests: &[BlockReadRequest], stream: u64, ) -> Result<()>

2026-09-25: The block form of read_async. The default fans out to read_async.

Source

fn write_block_from_host( &mut self, base_key: GroupKey, src: &[u8], ) -> Result<()>

2026-09-25: Write one whole block. src is block_bytes() laid out [K0, …, K(nkv-1), V0, …, V(nkv-1)] at group_stride pitch; only base_key’s layer and block are read. The default rejects any other length, then calls write_from_host for K(kh) and V(kh) of each head.

Source

fn write_blocks_run( &mut self, base_key: GroupKey, run_len: usize, src: &[u8], ) -> Result<()>

2026-09-25: Write run_len consecutive blocks of one layer, starting at base_key’s block; src is run_len · block_bytes(). The default rejects any other length, then calls write_block_from_host once per block.

Source

fn supports_write_run_coalescing(&self) -> bool

2026-09-25: Whether this backend serves write_blocks_run as one wide op. The default is false.

Source

fn register_landing_region(&mut self, base: u64, len: usize) -> Result<()>

2026-09-25: Register [base, base + len) as the region reads land in. The RDMA backends register it as one memory region per rail; the default does nothing.

Implementors§