Trait Backend

Source
pub trait Backend {
    // Required methods
    fn load(
        &self,
        owner: &str,
        slot: &str,
        limit: usize,
    ) -> Result<Option<Vec<u8>>, StorageError>;
    fn store(
        &self,
        owner: &str,
        slot: &str,
        bytes: &[u8],
    ) -> Result<(), StorageError>;

    // Provided method
    fn is_transient(&self) -> bool { ... }
}

Required Methods§

Source

fn load( &self, owner: &str, slot: &str, limit: usize, ) -> Result<Option<Vec<u8>>, StorageError>

Source

fn store( &self, owner: &str, slot: &str, bytes: &[u8], ) -> Result<(), StorageError>

DurabilityUncertain means complete data replaced the destination, but the parent-directory durability check failed. Other errors do not confirm commit.

Provided Methods§

Implementors§