Struct mls_rs::group::external_commit::ExternalCommitBuilder
source · pub struct ExternalCommitBuilder<C: ClientConfig> { /* private fields */ }
Expand description
A builder that aids with the construction of an external commit.
Implementations§
source§impl<C: ClientConfig> ExternalCommitBuilder<C>
impl<C: ClientConfig> ExternalCommitBuilder<C>
sourcepub fn with_tree_data(self, tree_data: ExportedTree<'static>) -> Self
pub fn with_tree_data(self, tree_data: ExportedTree<'static>) -> Self
Use external tree data if the GroupInfo message does not contain a
RatchetTreeExt
sourcepub fn with_removal(self, to_remove: u32) -> Self
pub fn with_removal(self, to_remove: u32) -> Self
Propose the removal of an old version of the client as part of the external commit. Only one such proposal is allowed.
sourcepub fn with_authenticated_data(self, data: Vec<u8>) -> Self
pub fn with_authenticated_data(self, data: Vec<u8>) -> Self
Add plaintext authenticated data to the resulting commit message.
sourcepub fn with_external_psk(self, psk: ExternalPskId) -> Self
pub fn with_external_psk(self, psk: ExternalPskId) -> Self
Add an external psk to the group as part of the external commit.
sourcepub fn with_custom_proposal(self, proposal: CustomProposal) -> Self
pub fn with_custom_proposal(self, proposal: CustomProposal) -> Self
Insert a CustomProposal
into the current commit that is being built.
sourcepub fn with_received_custom_proposal(self, proposal: MlsMessage) -> Self
pub fn with_received_custom_proposal(self, proposal: MlsMessage) -> Self
Insert a CustomProposal
received from a current group member into the current
commit that is being built.
Warning
The authenticity of the proposal is NOT fully verified. It is only verified the
same way as by ExternalGroup
.
The proposal MUST be an MlsPlaintext, else the Self::build
function will fail.
sourcepub fn build(
self,
group_info: MlsMessage
) -> Result<(Group<C>, MlsMessage), MlsError>
pub fn build( self, group_info: MlsMessage ) -> Result<(Group<C>, MlsMessage), MlsError>
Build the external commit using a GroupInfo message provided by an existing group member.