pub enum MlsGroupState {
PendingCommit(Box<PendingCommitState>),
Operational,
Inactive,
}
Expand description
MlsGroupState
determines the state of an MlsGroup
. The different
states and their transitions are as follows:
-
MlsGroupState::Operational
: This is the main state of the group, which allows access to all of its functionality, (except merging pending commits, see theMlsGroupState::PendingCommit
for more information) and it’s the state the group starts in (except when created viaMlsGroup::join_by_external_commit()
, see the functions documentation for more information). From thisOperational
, the group state can either transition toMlsGroupState::Inactive
, when it processes a commit that removes this client from the group, or toMlsGroupState::PendingCommit
, when this client creates a commit. -
MlsGroupState::Inactive
: A group can enter this state from any other state when it processes a commit that removes this client from the group. This is a terminal state that the group can not exit from. If the clients wants to re-join the group, it can either be added by a group member or it can join via external commit. -
MlsGroupState::PendingCommit
: This state is split into two possible sub-states, one for each Commit type:PendingCommitState::Member
andPendingCommitState::External
:-
If the client creates a commit for this group, the
PendingCommit
state is entered withPendingCommitState::Member
and with theStagedCommit
as additional state variable. In this state, it can perform the same operations as in theMlsGroupState::Operational
, except that it cannot create proposals or commits. However, it can merge or clear the storedStagedCommit
, where both actions result in a transition to theMlsGroupState::Operational
. Additionally, if a commit from another group member is processed, the own pending commit is also cleared and either theInactive
state is entered (if this client was removed from the group as part of the processed commit), or theOperational
state is entered. -
A group can enter the
PendingCommitState::External
sub-state only as the initial state when the group is created viaMlsGroup::join_by_external_commit()
. In contrast to thePendingCommitState::Member
PendingCommit
state, the only possible functionality that can be used is theMlsGroup::merge_pending_commit()
function, which merges the pending external commit and transitions the state toMlsGroupState::PendingCommit
. For more information on the external commit process, seeMlsGroup::join_by_external_commit()
or Section 11.2.1 of the MLS specification.
-
Variants§
PendingCommit(Box<PendingCommitState>)
There is currently a pending Commit that hasn’t been merged yet.
Operational
The group state is in an opertaional state, where new messages and Commits can be created.
Inactive
The group is inactive because the member has been removed.
Trait Implementations§
Source§impl Debug for MlsGroupState
impl Debug for MlsGroupState
Source§impl<'de> Deserialize<'de> for MlsGroupState
impl<'de> Deserialize<'de> for MlsGroupState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for MlsGroupState
impl Serialize for MlsGroupState
impl Entity<CURRENT_VERSION> for MlsGroupState
impl GroupState<CURRENT_VERSION> for MlsGroupState
Auto Trait Implementations§
impl Freeze for MlsGroupState
impl RefUnwindSafe for MlsGroupState
impl Send for MlsGroupState
impl Sync for MlsGroupState
impl Unpin for MlsGroupState
impl UnwindSafe for MlsGroupState
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
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>
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>
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