[−][src]Trait self_encryption::Storage
Trait which must be implemented by storage objects to be used in self-encryption. Data is
passed to the storage object encrypted with name
being the SHA3-256 hash of data
. Storage
could be implemented as an in-memory HashMap
or a disk-based container for example.
Associated Types
type Error: StorageError
Error type returned by get
or put
.
Required methods
fn get(
&self,
name: &[u8]
) -> Box<dyn Future<Item = Vec<u8>, Error = Self::Error>>
&self,
name: &[u8]
) -> Box<dyn Future<Item = Vec<u8>, Error = Self::Error>>
Retrieve data previously put
under name
. If the data does not exist, an error should be
returned.
fn put(
&mut self,
name: Vec<u8>,
data: Vec<u8>
) -> Box<dyn Future<Item = (), Error = Self::Error>>
&mut self,
name: Vec<u8>,
data: Vec<u8>
) -> Box<dyn Future<Item = (), Error = Self::Error>>
Store data
under name
.