[−][src]Trait self_encryption::Storage
Trait inherited from std::error::Error
representing errors which can be returned by the
Storage
object.
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.
Required methods
#[must_use]pub fn get<'life0, 'life1, 'async_trait>(
&'life0 mut self,
name: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SelfEncryptionError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
name: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SelfEncryptionError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Retrieve data previously put
under name
. If the data does not exist, an error should be
returned.
#[must_use]pub fn put<'life0, 'async_trait>(
&'life0 mut self,
name: Vec<u8>,
data: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<(), SelfEncryptionError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
name: Vec<u8>,
data: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<(), SelfEncryptionError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Store data
under name
.
#[must_use]pub fn generate_address<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SelfEncryptionError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
data: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SelfEncryptionError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Generate the address at which the data will be stored. This address will be stored as a part of the data map.