StorageBackend

Trait StorageBackend 

Source
pub trait StorageBackend: Send + Sync {
    // Required methods
    fn load_index(&self, index_id: &str) -> Result<Vec<u8>>;
    fn save_index(&mut self, index_id: &str, data: &[u8]) -> Result<()>;
    fn delete_index(&mut self, index_id: &str) -> Result<()>;
    fn exists(&self, index_id: &str) -> bool;
    fn get_size(&self, index_id: &str) -> Result<u64>;
    fn list_indices(&self) -> Result<Vec<String>>;
    fn backend_type(&self) -> &'static str;
}
Expand description

Storage backend trait for tier implementations

Required Methods§

Source

fn load_index(&self, index_id: &str) -> Result<Vec<u8>>

Load an index from storage

Source

fn save_index(&mut self, index_id: &str, data: &[u8]) -> Result<()>

Save an index to storage

Source

fn delete_index(&mut self, index_id: &str) -> Result<()>

Delete an index from storage

Source

fn exists(&self, index_id: &str) -> bool

Check if an index exists

Source

fn get_size(&self, index_id: &str) -> Result<u64>

Get the size of an index in bytes

Source

fn list_indices(&self) -> Result<Vec<String>>

List all indices in this storage

Source

fn backend_type(&self) -> &'static str

Get storage backend type name

Implementors§