pub struct PublicGroup { /* private fields */ }Expand description
This struct holds all public values of an MLS group.
Implementations§
Source§impl PublicGroup
impl PublicGroup
Sourcepub fn process_message(
&self,
crypto: &impl OpenMlsCrypto,
message: impl Into<ProtocolMessage>,
) -> Result<ProcessedMessage, PublicProcessMessageError>
pub fn process_message( &self, crypto: &impl OpenMlsCrypto, message: impl Into<ProtocolMessage>, ) -> Result<ProcessedMessage, PublicProcessMessageError>
This function is used to parse messages from the DS. It checks for syntactic errors and does semantic validation as well. It returns a ProcessedMessage enum. Checks the following semantic validation:
- ValSem002
- ValSem003
- ValSem004
- ValSem005
- ValSem006
- ValSem007
- ValSem008
- ValSem009
- ValSem010
- ValSem101
- ValSem102
- ValSem104
- ValSem106
- ValSem107
- ValSem108
- ValSem110
- ValSem111
- ValSem112
- ValSem200
- ValSem201
- ValSem202: Path must be the right length
- ValSem203: Path secrets must decrypt correctly
- ValSem204: Public keys from Path must be verified and match the private keys from the direct path
- ValSem205
- ValSem240
- ValSem241
- ValSem242
- ValSem244
- ValSem245
- ValSem246 (as part of ValSem010)
Source§impl PublicGroup
impl PublicGroup
Sourcepub fn merge_commit<Storage: PublicStorageProvider>(
&mut self,
storage: &Storage,
staged_commit: StagedCommit,
) -> Result<(), MergeCommitError<Storage::Error>>
pub fn merge_commit<Storage: PublicStorageProvider>( &mut self, storage: &Storage, staged_commit: StagedCommit, ) -> Result<(), MergeCommitError<Storage::Error>>
Merges a StagedCommit into the public group state.
Source§impl PublicGroup
impl PublicGroup
Sourcepub fn from_external<StorageProvider, StorageError>(
crypto: &impl OpenMlsCrypto,
storage: &StorageProvider,
ratchet_tree: RatchetTreeIn,
verifiable_group_info: VerifiableGroupInfo,
proposal_store: ProposalStore,
) -> Result<(Self, GroupInfo), CreationFromExternalError<StorageError>>where
StorageProvider: PublicStorageProvider<Error = StorageError>,
pub fn from_external<StorageProvider, StorageError>(
crypto: &impl OpenMlsCrypto,
storage: &StorageProvider,
ratchet_tree: RatchetTreeIn,
verifiable_group_info: VerifiableGroupInfo,
proposal_store: ProposalStore,
) -> Result<(Self, GroupInfo), CreationFromExternalError<StorageError>>where
StorageProvider: PublicStorageProvider<Error = StorageError>,
Create a PublicGroup instance to start tracking an existing MLS group.
This function performs basic validation checks and returns an error if
one of the checks fails. See CreationFromExternalError for more
details.
Sourcepub fn ext_commit_sender_index(
&self,
commit: &StagedCommit,
) -> Result<LeafNodeIndex, LibraryError>
pub fn ext_commit_sender_index( &self, commit: &StagedCommit, ) -> Result<LeafNodeIndex, LibraryError>
Returns the index of the sender of a staged, external commit.
Sourcepub fn members(&self) -> impl Iterator<Item = Member> + '_
pub fn members(&self) -> impl Iterator<Item = Member> + '_
Get an iterator over all Members of this PublicGroup.
Sourcepub fn export_ratchet_tree(&self) -> RatchetTree
pub fn export_ratchet_tree(&self) -> RatchetTree
Export the nodes of the public tree.
Sourcepub fn add_proposal<Storage: PublicStorageProvider>(
&mut self,
storage: &Storage,
proposal: QueuedProposal,
) -> Result<(), Storage::Error>
pub fn add_proposal<Storage: PublicStorageProvider>( &mut self, storage: &Storage, proposal: QueuedProposal, ) -> Result<(), Storage::Error>
Add the QueuedProposal to the PublicGroups internal ProposalStore.
Sourcepub fn remove_proposal<Storage: PublicStorageProvider>(
&mut self,
storage: &Storage,
proposal_ref: &ProposalRef,
) -> Result<(), Storage::Error>
pub fn remove_proposal<Storage: PublicStorageProvider>( &mut self, storage: &Storage, proposal_ref: &ProposalRef, ) -> Result<(), Storage::Error>
Remove the Proposal with the given ProposalRef from the PublicGroups internal ProposalStore.
Sourcepub fn queued_proposals<Storage: PublicStorageProvider>(
&self,
storage: &Storage,
) -> Result<Vec<(ProposalRef, QueuedProposal)>, Storage::Error>
pub fn queued_proposals<Storage: PublicStorageProvider>( &self, storage: &Storage, ) -> Result<Vec<(ProposalRef, QueuedProposal)>, Storage::Error>
Return all queued proposals
Source§impl PublicGroup
impl PublicGroup
Sourcepub fn ciphersuite(&self) -> Ciphersuite
pub fn ciphersuite(&self) -> Ciphersuite
Get the ciphersuite.
Sourcepub fn version(&self) -> ProtocolVersion
pub fn version(&self) -> ProtocolVersion
Get the version.
Sourcepub fn group_context(&self) -> &GroupContext
pub fn group_context(&self) -> &GroupContext
Get the group context.
Sourcepub fn required_capabilities(&self) -> Option<&RequiredCapabilitiesExtension>
pub fn required_capabilities(&self) -> Option<&RequiredCapabilitiesExtension>
Get the required capabilities.
Sourcepub fn confirmation_tag(&self) -> &ConfirmationTag
pub fn confirmation_tag(&self) -> &ConfirmationTag
Get confirmation tag.
Sourcepub fn leaf(&self, leaf_index: LeafNodeIndex) -> Option<&LeafNode>
pub fn leaf(&self, leaf_index: LeafNodeIndex) -> Option<&LeafNode>
Return a reference to the leaf at the given LeafNodeIndex or None if the
leaf is blank.
Sourcepub fn delete<Storage: PublicStorageProvider>(
storage: &Storage,
group_id: &GroupId,
) -> Result<(), Storage::Error>
pub fn delete<Storage: PublicStorageProvider>( storage: &Storage, group_id: &GroupId, ) -> Result<(), Storage::Error>
Deletes the PublicGroup from storage.
Sourcepub fn load<Storage: PublicStorageProvider>(
storage: &Storage,
group_id: &GroupId,
) -> Result<Option<Self>, Storage::Error>
pub fn load<Storage: PublicStorageProvider>( storage: &Storage, group_id: &GroupId, ) -> Result<Option<Self>, Storage::Error>
Loads the PublicGroup corresponding to a GroupId from storage.
Trait Implementations§
Source§impl Clone for PublicGroup
impl Clone for PublicGroup
Source§fn clone(&self) -> PublicGroup
fn clone(&self) -> PublicGroup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PublicGroup
impl Debug for PublicGroup
Source§impl PartialEq for PublicGroup
impl PartialEq for PublicGroup
impl StructuralPartialEq for PublicGroup
Auto Trait Implementations§
impl Freeze for PublicGroup
impl RefUnwindSafe for PublicGroup
impl Send for PublicGroup
impl Sync for PublicGroup
impl Unpin for PublicGroup
impl UnwindSafe for PublicGroup
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
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> 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