pub trait DhtStorage: Send + Sync {
// Required methods
fn store(&self, key: &[u8], data: &[u8]) -> Result<()>;
fn retrieve(&self, key: &[u8]) -> Result<Option<Vec<u8>>>;
fn delete(&self, key: &[u8]) -> Result<()>;
fn exists(&self, key: &[u8]) -> Result<bool>;
}Expand description
Distributed hash table storage backend.
Default implementation is in-memory (for testing/standalone usage).
Enable dht-storage feature for real lib-storage integration.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".