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
Abstraction over a MLS group capable of decrypting a MLS message
impl MlsConversation
Abstraction over a MLS group capable of decrypting a MLS message
Sourcepub async fn decrypt_message(
&mut self,
message: MlsMessageIn,
parent_conv: Option<&Arc<RwLock<MlsConversation>>>,
client: &Client,
backend: &MlsCryptoProvider,
restore_pending: bool,
) -> Result<MlsConversationDecryptMessage>
pub async fn decrypt_message( &mut self, message: MlsMessageIn, parent_conv: Option<&Arc<RwLock<MlsConversation>>>, client: &Client, backend: &MlsCryptoProvider, restore_pending: bool, ) -> Result<MlsConversationDecryptMessage>
Source§impl MlsConversation
impl MlsConversation
Sourcepub fn export_secret_key(
&self,
backend: &impl OpenMlsCryptoProvider,
key_length: usize,
) -> Result<Vec<u8>>
pub fn export_secret_key( &self, backend: &impl OpenMlsCryptoProvider, key_length: usize, ) -> Result<Vec<u8>>
Sourcepub fn get_client_ids(&self) -> Vec<ClientId>
pub fn get_client_ids(&self) -> Vec<ClientId>
Source§impl MlsConversation
Abstraction over a MLS group capable of merging a commit
impl MlsConversation
Abstraction over a MLS group capable of merging a commit
Sourcepub async fn clear_pending_proposal(
&mut self,
proposal_ref: MlsProposalRef,
backend: &MlsCryptoProvider,
) -> Result<()>
pub async fn clear_pending_proposal( &mut self, proposal_ref: MlsProposalRef, backend: &MlsCryptoProvider, ) -> Result<()>
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
Sourcepub async fn mark_as_child_of(
&mut self,
parent_id: &ConversationId,
keystore: &Connection,
) -> Result<()>
pub async fn mark_as_child_of( &mut self, parent_id: &ConversationId, keystore: &Connection, ) -> Result<()>
Marks this conversation as child of another. Prequisite: Being a member of this group and for it to be stored in the keystore
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read moreSource§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