pub trait OpenMlsKeyStore: Send + Sync {
    type Error: Error + Debug + PartialEq<Self::Error>;

    // Required methods
    fn store<V>(&self, k: &[u8], v: &V) -> Result<(), Self::Error>
       where V: MlsEntity,
             Self: Sized;
    fn read<V>(&self, k: &[u8]) -> Option<V>
       where V: MlsEntity,
             Self: Sized;
    fn delete<V>(&self, k: &[u8]) -> Result<(), Self::Error>
       where V: MlsEntity;
}
Expand description

The Key Store trait

Required Associated Types§

source

type Error: Error + Debug + PartialEq<Self::Error>

The error type returned by the OpenMlsKeyStore.

Required Methods§

source

fn store<V>(&self, k: &[u8], v: &V) -> Result<(), Self::Error>where V: MlsEntity, Self: Sized,

Store a value v that implements the MlsEntity trait for serialization for ID k.

Returns an error if storing fails.

source

fn read<V>(&self, k: &[u8]) -> Option<V>where V: MlsEntity, Self: Sized,

Read and return a value stored for ID k that implements the MlsEntity trait for deserialization.

Returns None if no value is stored for k or reading fails.

source

fn delete<V>(&self, k: &[u8]) -> Result<(), Self::Error>where V: MlsEntity,

Delete a value stored for ID k.

Returns an error if storing fails.

Implementors§