Struct PublicGroup
pub struct PublicGroup { /* private fields */ }Expand description
This struct holds all public values of an MLS group.
Implementations§
§impl PublicGroup
impl PublicGroup
pub 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)
§impl PublicGroup
impl PublicGroup
pub fn merge_commit<Storage>(
&mut self,
storage: &Storage,
staged_commit: StagedCommit,
) -> Result<(), MergeCommitError<<Storage as PublicStorageProvider>::Error>>where
Storage: PublicStorageProvider,
pub fn merge_commit<Storage>(
&mut self,
storage: &Storage,
staged_commit: StagedCommit,
) -> Result<(), MergeCommitError<<Storage as PublicStorageProvider>::Error>>where
Storage: PublicStorageProvider,
Merges a StagedCommit into the public group state.
§impl PublicGroup
impl PublicGroup
pub fn from_external<StorageProvider, StorageError>(
crypto: &impl OpenMlsCrypto,
storage: &StorageProvider,
ratchet_tree: RatchetTreeIn,
verifiable_group_info: VerifiableGroupInfo,
proposal_store: ProposalStore,
) -> Result<(PublicGroup, 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<(PublicGroup, 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.
pub 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.
pub fn members(&self) -> impl Iterator<Item = Member>
pub fn members(&self) -> impl Iterator<Item = Member>
Get an iterator over all Members of this PublicGroup.
pub fn export_ratchet_tree(&self) -> RatchetTree
pub fn export_ratchet_tree(&self) -> RatchetTree
Export the nodes of the public tree.
pub fn add_proposal<Storage>(
&mut self,
storage: &Storage,
proposal: QueuedProposal,
) -> Result<(), <Storage as PublicStorageProvider>::Error>where
Storage: PublicStorageProvider,
pub fn add_proposal<Storage>(
&mut self,
storage: &Storage,
proposal: QueuedProposal,
) -> Result<(), <Storage as PublicStorageProvider>::Error>where
Storage: PublicStorageProvider,
Add the QueuedProposal to the PublicGroups internal ProposalStore.
pub fn remove_proposal<Storage>(
&mut self,
storage: &Storage,
proposal_ref: &HashReference,
) -> Result<(), <Storage as PublicStorageProvider>::Error>where
Storage: PublicStorageProvider,
pub fn remove_proposal<Storage>(
&mut self,
storage: &Storage,
proposal_ref: &HashReference,
) -> Result<(), <Storage as PublicStorageProvider>::Error>where
Storage: PublicStorageProvider,
Remove the Proposal with the given ProposalRef from the PublicGroups internal ProposalStore.
pub fn queued_proposals<Storage>(
&self,
storage: &Storage,
) -> Result<Vec<(HashReference, QueuedProposal)>, <Storage as PublicStorageProvider>::Error>where
Storage: PublicStorageProvider,
pub fn queued_proposals<Storage>(
&self,
storage: &Storage,
) -> Result<Vec<(HashReference, QueuedProposal)>, <Storage as PublicStorageProvider>::Error>where
Storage: PublicStorageProvider,
Return all queued proposals
§impl PublicGroup
impl PublicGroup
pub fn ciphersuite(&self) -> Ciphersuite
pub fn ciphersuite(&self) -> Ciphersuite
Get the ciphersuite.
pub fn version(&self) -> ProtocolVersion
pub fn version(&self) -> ProtocolVersion
Get the version.
pub fn group_context(&self) -> &GroupContext
pub fn group_context(&self) -> &GroupContext
Get the group context.
pub fn required_capabilities(&self) -> Option<&RequiredCapabilitiesExtension>
pub fn required_capabilities(&self) -> Option<&RequiredCapabilitiesExtension>
Get the required capabilities.
pub fn confirmation_tag(&self) -> &ConfirmationTag
pub fn confirmation_tag(&self) -> &ConfirmationTag
Get confirmation tag.
pub 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.
pub fn delete<Storage>(
storage: &Storage,
group_id: &GroupId,
) -> Result<(), <Storage as PublicStorageProvider>::Error>where
Storage: PublicStorageProvider,
pub fn delete<Storage>(
storage: &Storage,
group_id: &GroupId,
) -> Result<(), <Storage as PublicStorageProvider>::Error>where
Storage: PublicStorageProvider,
Deletes the PublicGroup from storage.
pub fn load<Storage>(
storage: &Storage,
group_id: &GroupId,
) -> Result<Option<PublicGroup>, <Storage as PublicStorageProvider>::Error>where
Storage: PublicStorageProvider,
pub fn load<Storage>(
storage: &Storage,
group_id: &GroupId,
) -> Result<Option<PublicGroup>, <Storage as PublicStorageProvider>::Error>where
Storage: PublicStorageProvider,
Loads the PublicGroup corresponding to a GroupId from storage.
Trait Implementations§
§impl Clone for PublicGroup
impl Clone for PublicGroup
§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 more§impl Debug for PublicGroup
impl Debug for PublicGroup
§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> Conv for T
impl<T> Conv for T
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.