pub struct MlsConversation { /* private fields */ }
Expand description
Implementations§
Source§impl MlsConversation
impl MlsConversation
Sourcepub fn compute_next_commit_delay(&self) -> Option<u64>
pub fn compute_next_commit_delay(&self) -> Option<u64>
Helps consumer by providing a deterministic delay in seconds for him to commit its pending proposal. It depends on the index of the client in the ratchet tree
self_index
- ratchet tree index of self clientepoch
- current group epochnb_members
- number of clients in the group
Source§impl MlsConversation
Creating proposals
impl MlsConversation
Creating proposals
Sourcepub async fn propose_add_member(
&mut self,
client: &Client,
backend: &MlsCryptoProvider,
key_package: KeyPackageIn,
) -> Result<MlsProposalBundle>
pub async fn propose_add_member( &mut self, client: &Client, backend: &MlsCryptoProvider, key_package: KeyPackageIn, ) -> Result<MlsProposalBundle>
Sourcepub async fn propose_remove_member(
&mut self,
client: &Client,
backend: &MlsCryptoProvider,
member: LeafNodeIndex,
) -> Result<MlsProposalBundle>
pub async fn propose_remove_member( &mut self, client: &Client, backend: &MlsCryptoProvider, member: LeafNodeIndex, ) -> Result<MlsProposalBundle>
Sourcepub async fn propose_self_update(
&mut self,
client: &Client,
backend: &MlsCryptoProvider,
) -> Result<MlsProposalBundle>
pub async fn propose_self_update( &mut self, client: &Client, backend: &MlsCryptoProvider, ) -> Result<MlsProposalBundle>
Sourcepub async fn propose_explicit_self_update(
&mut self,
client: &Client,
backend: &MlsCryptoProvider,
leaf_node: Option<LeafNode>,
) -> Result<MlsProposalBundle>
pub async fn propose_explicit_self_update( &mut self, client: &Client, backend: &MlsCryptoProvider, leaf_node: Option<LeafNode>, ) -> Result<MlsProposalBundle>
Source§impl MlsConversation
impl MlsConversation
Sourcepub async fn create(
id: ConversationId,
author_client: &Client,
creator_credential_type: MlsCredentialType,
configuration: MlsConversationConfiguration,
backend: &MlsCryptoProvider,
) -> Result<Self>
pub async fn create( id: ConversationId, author_client: &Client, creator_credential_type: MlsCredentialType, configuration: MlsConversationConfiguration, backend: &MlsCryptoProvider, ) -> Result<Self>
Creates a new group/conversation
§Arguments
id
- group/conversation identifierauthor_client
- the client responsible for creating the groupcreator_credential_type
- kind of credential the creator wants to join the group withconfig
- group configurationbackend
- MLS Provider that will be used to persist the group
§Errors
Errors can happen from OpenMls or from the KeyStore
Sourcepub fn id(&self) -> &ConversationId
pub fn id(&self) -> &ConversationId
Group/conversation id
Sourcepub fn members(&self) -> HashMap<Vec<u8>, Credential>
pub fn members(&self) -> HashMap<Vec<u8>, Credential>
Returns all members credentials from the group/conversation
Sourcepub fn members_with_key(&self) -> HashMap<Vec<u8>, CredentialWithKey>
pub fn members_with_key(&self) -> HashMap<Vec<u8>, CredentialWithKey>
Returns all members credentials with their signature public key from the group/conversation
Source§impl MlsConversation
impl MlsConversation
Sourcepub fn members_in_next_epoch(&self) -> Vec<ClientId>
pub fn members_in_next_epoch(&self) -> Vec<ClientId>
Get actual group members and subtract pending remove proposals
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MlsConversation
impl RefUnwindSafe for MlsConversation
impl Send for MlsConversation
impl Sync for MlsConversation
impl Unpin for MlsConversation
impl UnwindSafe for MlsConversation
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
Mutably borrows from an owned value. Read more
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>
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 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>
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