pub trait Persist: Clone + Send {
// Required methods
fn put(&self, key: &PersistKey<'_>, value: &[u8]) -> Result<()>;
fn get(&self, key: &PersistKey<'_>) -> Result<Option<Vec<u8>>>;
}
Expand description
Trait for a persistence implementation.
Implementation must be clonable and thread safe (Send). This can easily be done by
wrapping the implemetation an Arc<Mutex<P>>
.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.