Skip to main content

HTTStorageProvider

Trait HTTStorageProvider 

Source
pub trait HTTStorageProvider: HTTExtensionBase {
Show 14 methods // Required methods fn store(&mut self, path: &str, data: &[u8]) -> ExtensionResult<()>; fn retrieve(&self, path: &str) -> ExtensionResult<Vec<u8>>; fn delete(&mut self, path: &str) -> ExtensionResult<()>; fn exists(&self, path: &str) -> ExtensionResult<bool>; fn list(&self, prefix: &str) -> ExtensionResult<Vec<String>>; fn get_metadata( &self, path: &str, ) -> ExtensionResult<HashMap<String, String>>; fn set_metadata( &mut self, path: &str, key: &str, value: &str, ) -> ExtensionResult<()>; fn flush(&mut self) -> ExtensionResult<()>; fn begin_transaction(&mut self) -> ExtensionResult<()>; fn commit_transaction(&mut self) -> ExtensionResult<()>; fn rollback_transaction(&mut self) -> ExtensionResult<()>; fn supports_transactions(&self) -> bool; fn is_available(&self) -> bool; fn stats(&self) -> ExtensionResult<HashMap<String, String>>;
}
Expand description

Storage provider interface for HTT.

Allows HTT to be integrated with various storage backends.

Required Methods§

Source

fn store(&mut self, path: &str, data: &[u8]) -> ExtensionResult<()>

Store data at the given path.

Source

fn retrieve(&self, path: &str) -> ExtensionResult<Vec<u8>>

Retrieve data from the given path.

Source

fn delete(&mut self, path: &str) -> ExtensionResult<()>

Delete data at the given path.

Source

fn exists(&self, path: &str) -> ExtensionResult<bool>

Check if data exists at the given path.

Source

fn list(&self, prefix: &str) -> ExtensionResult<Vec<String>>

List paths matching the given prefix.

Source

fn get_metadata(&self, path: &str) -> ExtensionResult<HashMap<String, String>>

Get metadata for the given path.

Source

fn set_metadata( &mut self, path: &str, key: &str, value: &str, ) -> ExtensionResult<()>

Set metadata for the given path.

Source

fn flush(&mut self) -> ExtensionResult<()>

Flush any pending changes to durable storage.

Source

fn begin_transaction(&mut self) -> ExtensionResult<()>

Begin a transaction.

Source

fn commit_transaction(&mut self) -> ExtensionResult<()>

Commit a transaction.

Source

fn rollback_transaction(&mut self) -> ExtensionResult<()>

Rollback a transaction.

Source

fn supports_transactions(&self) -> bool

Check if the provider supports transactions.

Source

fn is_available(&self) -> bool

Check if the provider is available.

Source

fn stats(&self) -> ExtensionResult<HashMap<String, String>>

Get provider statistics.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§