pub trait Storage {
// Required methods
fn get(&self, k: &[u8]) -> Result<Option<Vec<u8>>, StorageError>;
fn put(&mut self, k: Vec<u8>, v: Vec<u8>) -> Result<(), StorageError>;
fn remove(&mut self, k: &[u8]) -> Result<(), StorageError>;
}Expand description
Storge trait.
Required Methods§
Sourcefn get(&self, k: &[u8]) -> Result<Option<Vec<u8>>, StorageError>
fn get(&self, k: &[u8]) -> Result<Option<Vec<u8>>, StorageError>
Get an entry from the storage.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".