Skip to main content

StorageAdmin

Trait StorageAdmin 

Source
pub trait StorageAdmin:
    Send
    + Sync
    + Debug {
    // Required methods
    fn load_from_disk(&mut self) -> Result<(), StorageError>;
    fn save_to_disk(&self) -> Result<(), StorageError>;
    fn get_storage_stats(&self) -> StorageStats;
    fn find_dangling_edges(
        &self,
        space: &str,
    ) -> Result<Vec<Edge>, StorageError>;
    fn repair_dangling_edges(
        &mut self,
        space: &str,
    ) -> Result<usize, StorageError>;
    fn purge_expired(
        &self,
        space: &str,
        target: Option<PurgeTarget<'_>>,
    ) -> Result<Vec<TtlPurgeEntry>, StorageError>;
    fn get_db_path(&self) -> &str;
}
Expand description

Administrative operations: stats, maintenance, optional components.

Required Methods§

Source

fn load_from_disk(&mut self) -> Result<(), StorageError>

Source

fn save_to_disk(&self) -> Result<(), StorageError>

Source

fn get_storage_stats(&self) -> StorageStats

Source

fn find_dangling_edges(&self, space: &str) -> Result<Vec<Edge>, StorageError>

Source

fn repair_dangling_edges(&mut self, space: &str) -> Result<usize, StorageError>

Source

fn purge_expired( &self, space: &str, target: Option<PurgeTarget<'_>>, ) -> Result<Vec<TtlPurgeEntry>, StorageError>

Physically delete TTL-expired rows.

target = None scans every TTL-configured tag and edge type in the space and returns one TtlPurgeEntry per such schema (even when it deletes nothing). target = Some(..) scans only that schema and returns its single entry, whose removed is 0 when the schema exists but has no TTL or nothing expired; a schema that does not exist is an explicit error. Deletions run through the normal write path, so they are WAL-logged and crash-recoverable.

Callers are the PURGE EXPIRED statement and the optional background sweep (StorageTtlPurgeOps), which invokes this per space without a target schema. Both share this one entry point.

Source

fn get_db_path(&self) -> &str

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§