pub struct CommitBuilder<'a, C>where
C: ClientConfig + Clone,{ /* private fields */ }
Expand description
Build a commit with multiple proposals by-value.
Proposals within a commit can be by-value or by-reference. Proposals received during the current epoch will be added to the resulting commit by-reference automatically so long as they pass the rules defined in the current proposal rules.
Implementations§
Source§impl<'a, C> CommitBuilder<'a, C>where
C: ClientConfig + Clone,
impl<'a, C> CommitBuilder<'a, C>where
C: ClientConfig + Clone,
Sourcepub fn add_member(
self,
key_package: MlsMessage,
) -> Result<CommitBuilder<'a, C>, MlsError>
pub fn add_member( self, key_package: MlsMessage, ) -> Result<CommitBuilder<'a, C>, MlsError>
Insert an AddProposal
into
the current commit that is being built.
Sourcepub fn set_group_info_ext(self, extensions: ExtensionList) -> Self
pub fn set_group_info_ext(self, extensions: ExtensionList) -> Self
Set group info extensions that will be inserted into the resulting welcome messages for new members.
Group info extensions that are transmitted as part of a welcome message are encrypted along with other private values.
These extensions can be retrieved as part of
NewMemberInfo
that is returned
by joining the group via
Client::join_group
.
Sourcepub fn remove_member(self, index: u32) -> Result<Self, MlsError>
pub fn remove_member(self, index: u32) -> Result<Self, MlsError>
Insert a RemoveProposal
into
the current commit that is being built.
Sourcepub fn set_group_context_ext(
self,
extensions: ExtensionList,
) -> Result<Self, MlsError>
pub fn set_group_context_ext( self, extensions: ExtensionList, ) -> Result<Self, MlsError>
Insert a
GroupContextExtensions
into the current commit that is being built.
Sourcepub fn add_external_psk(self, psk_id: ExternalPskId) -> Result<Self, MlsError>
pub fn add_external_psk(self, psk_id: ExternalPskId) -> Result<Self, MlsError>
Insert a
PreSharedKeyProposal
with
an external PSK into the current commit that is being built.
Sourcepub fn add_resumption_psk(self, psk_epoch: u64) -> Result<Self, MlsError>
pub fn add_resumption_psk(self, psk_epoch: u64) -> Result<Self, MlsError>
Insert a
PreSharedKeyProposal
with
a resumption PSK into the current commit that is being built.
Sourcepub fn reinit(
self,
group_id: Option<Vec<u8>>,
version: ProtocolVersion,
cipher_suite: CipherSuite,
extensions: ExtensionList,
) -> Result<Self, MlsError>
pub fn reinit( self, group_id: Option<Vec<u8>>, version: ProtocolVersion, cipher_suite: CipherSuite, extensions: ExtensionList, ) -> Result<Self, MlsError>
Insert a ReInitProposal
into
the current commit that is being built.
Sourcepub fn custom_proposal(self, proposal: CustomProposal) -> Self
pub fn custom_proposal(self, proposal: CustomProposal) -> Self
Insert a CustomProposal
into
the current commit that is being built.
Sourcepub fn raw_proposal(self, proposal: Proposal) -> Self
pub fn raw_proposal(self, proposal: Proposal) -> Self
Insert a proposal that was previously constructed such as when a
proposal is returned from
NewEpoch::unused_proposals
.
Sourcepub fn raw_proposals(self, proposals: Vec<Proposal>) -> Self
pub fn raw_proposals(self, proposals: Vec<Proposal>) -> Self
Insert proposals that were previously constructed such as when a
proposal is returned from
NewEpoch::unused_proposals
.
Sourcepub fn authenticated_data(self, authenticated_data: Vec<u8>) -> Self
pub fn authenticated_data(self, authenticated_data: Vec<u8>) -> Self
Add additional authenticated data to the commit.
§Warning
The data provided here is always sent unencrypted.
Sourcepub fn set_new_signing_identity(
self,
signer: SignatureSecretKey,
signing_identity: SigningIdentity,
) -> Self
pub fn set_new_signing_identity( self, signer: SignatureSecretKey, signing_identity: SigningIdentity, ) -> Self
Change the committer’s signing identity as part of making this commit.
This will only succeed if the IdentityProvider
in use by the group considers the credential inside this signing_identity
valid
and results in the same
identity
being used.
Sourcepub fn set_leaf_node_extensions(
self,
new_leaf_node_extensions: ExtensionList,
) -> Self
pub fn set_leaf_node_extensions( self, new_leaf_node_extensions: ExtensionList, ) -> Self
Change the committer’s leaf node extensions as part of making this commit.
Sourcepub fn commit_time(self, commit_time: MlsTime) -> Self
pub fn commit_time(self, commit_time: MlsTime) -> Self
Add a time to associate with the commit creation.
Sourcepub fn build(self) -> Result<CommitOutput, MlsError>
pub fn build(self) -> Result<CommitOutput, MlsError>
Finalize the commit to send.
§Errors
This function will return an error if any of the proposals provided are not contextually valid according to the rules defined by the MLS RFC, or if they do not pass the custom rules defined by the current proposal rules.
Sourcepub fn build_detached(self) -> Result<(CommitOutput, CommitSecrets), MlsError>
pub fn build_detached(self) -> Result<(CommitOutput, CommitSecrets), MlsError>
The same function as GroupBuilder::build
except the secrets generated
for the commit are outputted instead of being cached internally.
A detached commit can be applied using Group::apply_detached_commit
.
Auto Trait Implementations§
impl<'a, C> Freeze for CommitBuilder<'a, C>
impl<'a, C> RefUnwindSafe for CommitBuilder<'a, C>where
C: RefUnwindSafe,
<<C as ClientConfig>::CryptoProvider as CryptoProvider>::CipherSuiteProvider: RefUnwindSafe,
<C as ClientConfig>::GroupStateStorage: RefUnwindSafe,
<C as ClientConfig>::KeyPackageRepository: RefUnwindSafe,
impl<'a, C> Send for CommitBuilder<'a, C>
impl<'a, C> Sync for CommitBuilder<'a, C>
impl<'a, C> Unpin for CommitBuilder<'a, C>
impl<'a, C> !UnwindSafe for CommitBuilder<'a, C>
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