pub trait KeyPackageStorage: Send + Sync {
type Error: IntoAnyError;
// Required methods
fn delete(&mut self, id: &[u8]) -> Result<(), Self::Error>;
fn insert(
&mut self,
id: Vec<u8>,
pkg: KeyPackageData,
) -> Result<(), Self::Error>;
fn get(&self, id: &[u8]) -> Result<Option<KeyPackageData>, Self::Error>;
}Expand description
Storage trait that maintains key package secrets.
Required Associated Types§
Sourcetype Error: IntoAnyError
type Error: IntoAnyError
Error type that the underlying storage mechanism returns on internal failure.
Required Methods§
Sourcefn delete(&mut self, id: &[u8]) -> Result<(), Self::Error>
fn delete(&mut self, id: &[u8]) -> Result<(), Self::Error>
Delete KeyPackageData referenced by id.
This function is called automatically when the key package referenced
by id is used to successfully join a group.
§Warning
KeyPackageData internally contains secret key values. The
provided delete mechanism should securely erase data.
Sourcefn insert(
&mut self,
id: Vec<u8>,
pkg: KeyPackageData,
) -> Result<(), Self::Error>
fn insert( &mut self, id: Vec<u8>, pkg: KeyPackageData, ) -> Result<(), Self::Error>
Store KeyPackageData that can be accessed by id in the future.
This function is automatically called whenever a new key package is created.
Sourcefn get(&self, id: &[u8]) -> Result<Option<KeyPackageData>, Self::Error>
fn get(&self, id: &[u8]) -> Result<Option<KeyPackageData>, Self::Error>
Retrieve KeyPackageData by its id.
None should be returned in the event that no key packages are found
that match id.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".