pub struct ConversationMut { /* private fields */ }Expand description
A mutable view of an MLS conversation.
The conversation is ultimately owned by the conversation
cache, but we take an Arc here so that we don’t have to tie
the lifetime of the guard to the cache.
More generally, the conversation guard gives us convenient mutable accesses to a single
conversation. This in turn means that we don’t have to duplicate the entire
conversation API on TransactionContext.
Implementations§
Source§impl ConversationMut
impl ConversationMut
Sourcepub async fn add_members(
&mut self,
key_packages: Vec<KeyPackageIn>,
) -> Result<()>
pub async fn add_members( &mut self, key_packages: Vec<KeyPackageIn>, ) -> Result<()>
Adds new members to the group/conversation
Sourcepub async fn remove_members(
&mut self,
clients: &[impl Borrow<ClientIdRef>],
) -> Result<()>
pub async fn remove_members( &mut self, clients: &[impl Borrow<ClientIdRef>], ) -> Result<()>
Removes clients from the group/conversation.
§Arguments
id- group/conversation idclients- list of client ids to be removed from the group
Sourcepub async fn update_key_material(&mut self) -> Result<()>
pub async fn update_key_material(&mut self) -> Result<()>
Self updates the own leaf node and automatically commits. Pending proposals will be committed.
Sourcepub async fn set_credential_by_ref(
&mut self,
credential_ref: &CredentialRef,
) -> Result<()>
pub async fn set_credential_by_ref( &mut self, credential_ref: &CredentialRef, ) -> Result<()>
Set the referenced credential for this conversation.
Sourcepub async fn commit_pending_proposals(&mut self) -> Result<()>
pub async fn commit_pending_proposals(&mut self) -> Result<()>
Commits all pending proposals of the group
Source§impl ConversationMut
impl ConversationMut
Sourcepub async fn decrypt_message(
&mut self,
message: impl AsRef<[u8]>,
) -> Result<DecryptedMessage>
pub async fn decrypt_message( &mut self, message: impl AsRef<[u8]>, ) -> Result<DecryptedMessage>
Deserializes a TLS-serialized message, then processes it. Note: this will discard any local pending commits or proposals.
§Arguments
message- the encrypted message as a byte array
§Errors
If a message has been buffered, this will be indicated by an error. Other errors are originating from OpenMls and the KeyStore
Source§impl ConversationMut
impl ConversationMut
Sourcepub async fn encrypt_message(
&mut self,
message: impl AsRef<[u8]>,
) -> Result<Vec<u8>>
pub async fn encrypt_message( &mut self, message: impl AsRef<[u8]>, ) -> Result<Vec<u8>>
Encrypts a raw payload then serializes it to the TLS wire format.
Can only be called when there is no pending commit and no pending proposal.
§Arguments
message- the message as a byte array
§Return type
This method will return an encrypted TLS serialized message.
§Errors
If the conversation can’t be found, an error will be returned. Other errors are originating from OpenMls and the KeyStore
Source§impl ConversationMut
impl ConversationMut
Sourcepub async fn enable_history_sharing(&mut self) -> Result<()>
pub async fn enable_history_sharing(&mut self) -> Result<()>
Enable history sharing by generating a history client and adding it to the conversation.
Sourcepub async fn disable_history_sharing(&mut self) -> Result<()>
pub async fn disable_history_sharing(&mut self) -> Result<()>
Disable history sharing by removing history clients from the conversation.
Source§impl ConversationMut
impl ConversationMut
pub const fn new( inner: Arc<Conversation>, tx_context: TransactionContext, ) -> ConversationMut
Trait Implementations§
Source§impl Debug for ConversationMut
impl Debug for ConversationMut
Auto Trait Implementations§
impl Freeze for ConversationMut
impl !RefUnwindSafe for ConversationMut
impl Send for ConversationMut
impl Sync for ConversationMut
impl Unpin for ConversationMut
impl UnsafeUnpin for ConversationMut
impl !UnwindSafe for ConversationMut
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