pub struct InMemoryGroupStateStorage { /* private fields */ }
Expand description
In memory group state storage backed by a HashMap.
All clones of an instance of this type share the same underlying HashMap.
Implementations§
Source§impl InMemoryGroupStateStorage
impl InMemoryGroupStateStorage
pub fn with_max_epoch_retention( self, max_epoch_retention: usize, ) -> Result<Self, MlsError>
Sourcepub fn stored_groups(&self) -> Vec<Vec<u8>>
pub fn stored_groups(&self) -> Vec<Vec<u8>>
Get the set of unique group ids that have data stored.
Sourcepub fn delete_group(&self, group_id: &[u8])
pub fn delete_group(&self, group_id: &[u8])
Delete all data corresponding to group_id
.
Trait Implementations§
Source§impl Clone for InMemoryGroupStateStorage
impl Clone for InMemoryGroupStateStorage
Source§fn clone(&self) -> InMemoryGroupStateStorage
fn clone(&self) -> InMemoryGroupStateStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for InMemoryGroupStateStorage
impl Debug for InMemoryGroupStateStorage
Source§impl Default for InMemoryGroupStateStorage
impl Default for InMemoryGroupStateStorage
Source§impl GroupStateStorage for InMemoryGroupStateStorage
impl GroupStateStorage for InMemoryGroupStateStorage
type Error = Infallible
Source§fn max_epoch_id(&self, group_id: &[u8]) -> Result<Option<u64>, Self::Error>
fn max_epoch_id(&self, group_id: &[u8]) -> Result<Option<u64>, Self::Error>
The
EpochRecord::id
value that is associated with a stored
prior epoch for a particular group.Source§fn state(&self, group_id: &[u8]) -> Result<Option<Vec<u8>>, Self::Error>
fn state(&self, group_id: &[u8]) -> Result<Option<Vec<u8>>, Self::Error>
Fetch a group state from storage.
Source§fn epoch(
&self,
group_id: &[u8],
epoch_id: u64,
) -> Result<Option<Vec<u8>>, Self::Error>
fn epoch( &self, group_id: &[u8], epoch_id: u64, ) -> Result<Option<Vec<u8>>, Self::Error>
Lazy load cached epoch data from a particular group.
Source§fn write(
&mut self,
state: GroupState,
epoch_inserts: Vec<EpochRecord>,
epoch_updates: Vec<EpochRecord>,
) -> Result<(), Self::Error>
fn write( &mut self, state: GroupState, epoch_inserts: Vec<EpochRecord>, epoch_updates: Vec<EpochRecord>, ) -> Result<(), Self::Error>
Write pending state updates. Read more
Auto Trait Implementations§
impl Freeze for InMemoryGroupStateStorage
impl RefUnwindSafe for InMemoryGroupStateStorage
impl Send for InMemoryGroupStateStorage
impl Sync for InMemoryGroupStateStorage
impl Unpin for InMemoryGroupStateStorage
impl UnwindSafe for InMemoryGroupStateStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more