Trait self_encryption::Storage[][src]

pub trait Storage {
    #[must_use]
    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
;
#[must_use] 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
;
#[must_use] fn delete<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        name: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<(), SelfEncryptionError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] 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
; }

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]
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]

Retrieve data previously put under name. If the data does not exist, an error should be returned.

#[must_use]
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]

Store data under name.

#[must_use]
fn delete<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    name: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<(), SelfEncryptionError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Delete data under name.

#[must_use]
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]

Generate the address at which the data will be stored. This address will be stored as a part of the data map.

Loading content...

Implementors

Loading content...