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§
Sourcefn read(&mut self, requests: &[ReadRequest], stream: u64) -> Result<()>
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.
Sourcefn write_from_host(&mut self, key: GroupKey, src: &[u8]) -> Result<()>
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.
Sourcefn group_layout(&self) -> GroupLayout
fn group_layout(&self) -> GroupLayout
2026-09-25: The geometry the default block methods fan out with.
Provided Methods§
Sourcefn read_async(&mut self, requests: &[ReadRequest], stream: u64) -> Result<()>
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.
Sourcefn read_blocks(
&mut self,
requests: &[BlockReadRequest],
stream: u64,
) -> Result<()>
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.
Sourcefn read_blocks_async(
&mut self,
requests: &[BlockReadRequest],
stream: u64,
) -> Result<()>
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.
Sourcefn write_block_from_host(
&mut self,
base_key: GroupKey,
src: &[u8],
) -> Result<()>
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.
Sourcefn write_blocks_run(
&mut self,
base_key: GroupKey,
run_len: usize,
src: &[u8],
) -> Result<()>
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.
Sourcefn supports_write_run_coalescing(&self) -> bool
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.