Trait self_encryption::Storage [] [src]

pub trait Storage {
    type Error: StorageError;
    fn get(
        &self,
        name: &[u8]
    ) -> Box<Future<Item = Vec<u8>, Error = Self::Error>>;
fn put(
        &mut self,
        name: Vec<u8>,
        data: Vec<u8>
    ) -> Box<Future<Item = (), Error = Self::Error>>; }

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

Error type returned by get or put.

Required Methods

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

Store data under name.

Implementors