pub trait StorageBackend: Send + Sync {
// Required methods
fn write(&self, session_id: &Uuid, data: &[u8]) -> Result<()>;
fn read(&self, session_id: &Uuid) -> Result<Option<Vec<u8>>>;
fn write_named(&self, name: &str, data: &[u8]) -> Result<()>;
fn read_named(&self, name: &str) -> Result<Option<Vec<u8>>>;
fn delete(&self, session_id: &Uuid) -> Result<()>;
}Expand description
Backend abstraction for raw byte reads and atomic writes.
Required Methods§
Sourcefn write(&self, session_id: &Uuid, data: &[u8]) -> Result<()>
fn write(&self, session_id: &Uuid, data: &[u8]) -> Result<()>
Atomically write data to the file for session_id.
Sourcefn read(&self, session_id: &Uuid) -> Result<Option<Vec<u8>>>
fn read(&self, session_id: &Uuid) -> Result<Option<Vec<u8>>>
Read the raw bytes for session_id. Returns None if no file exists.
Sourcefn write_named(&self, name: &str, data: &[u8]) -> Result<()>
fn write_named(&self, name: &str, data: &[u8]) -> Result<()>
Write data under a fixed domain name (e.g. “manifest”).