Struct CommitBuilder

Source
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,

Source

pub fn add_member( self, key_package: MlsMessage, ) -> Result<CommitBuilder<'a, C>, MlsError>

Insert an AddProposal into the current commit that is being built.

Source

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.

Source

pub fn remove_member(self, index: u32) -> Result<Self, MlsError>

Insert a RemoveProposal into the current commit that is being built.

Source

pub fn set_group_context_ext( self, extensions: ExtensionList, ) -> Result<Self, MlsError>

Insert a GroupContextExtensions into the current commit that is being built.

Source

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.

Source

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.

Source

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.

Source

pub fn custom_proposal(self, proposal: CustomProposal) -> Self

Insert a CustomProposal into the current commit that is being built.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn commit_time(self, commit_time: MlsTime) -> Self

Add a time to associate with the commit creation.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.