pub struct Conversation { /* private fields */ }Expand description
A Conversation exposes the read-only interface of an MLS conversation.
Implementations§
Source§impl Conversation
impl Conversation
Sourcepub async fn get_client_ids(&self) -> Vec<ClientId>
pub async fn get_client_ids(&self) -> Vec<ClientId>
Sourcepub async fn members_in_next_epoch(&self) -> Vec<ClientId>
pub async fn members_in_next_epoch(&self) -> Vec<ClientId>
Get actual group members and subtract pending remove proposals
Source§impl Conversation
impl Conversation
Sourcepub async fn compute_next_commit_delay(&self) -> Option<u64>
pub async 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 Conversation
impl Conversation
Sourcepub async fn members(&self) -> HashMap<Vec<u8>, MlsCredential>
pub async fn members(&self) -> HashMap<Vec<u8>, MlsCredential>
Returns all members credentials from the group/conversation
Sourcepub async fn members_with_key(&self) -> HashMap<Vec<u8>, CredentialWithKey>
pub async fn members_with_key(&self) -> HashMap<Vec<u8>, CredentialWithKey>
Returns all members credentials with their signature public key from the group/conversation
Source§impl Conversation
impl Conversation
Sourcepub async fn e2ei_conversation_state(&self) -> Result<E2eiConversationState>
pub async fn e2ei_conversation_state(&self) -> Result<E2eiConversationState>
Indicates when to mark a conversation as not verified i.e. when not all its members have a X509 Credential generated by Wire’s end-to-end identity enrollment
Sourcepub async fn get_device_identities(
&self,
device_ids: &[impl Borrow<ClientIdRef> + Sync],
) -> Result<Vec<WireIdentity>>
pub async fn get_device_identities( &self, device_ids: &[impl Borrow<ClientIdRef> + Sync], ) -> Result<Vec<WireIdentity>>
From a given conversation, get the identity of the members supplied. Identity is only present for members with a Certificate Credential (after turning on end-to-end identity). If no member has a x509 certificate, it will return an empty Vec
Sourcepub async fn get_user_identities(
&self,
user_ids: &[String],
) -> Result<HashMap<String, Vec<WireIdentity>>>
pub async fn get_user_identities( &self, user_ids: &[String], ) -> Result<HashMap<String, Vec<WireIdentity>>>
From a given conversation, get the identity of the users (device holders) supplied. Identity is only present for devices with a Certificate Credential (after turning on end-to-end identity). If no member has a x509 certificate, it will return an empty Vec.
Returns a Map with all the identities for a given users. Consumers are then recommended to reduce those identities to determine the actual status of a user.
Source§impl Conversation
impl Conversation
Sourcepub async fn generate_history_secret(&self) -> Result<HistorySecret>
pub async fn generate_history_secret(&self) -> Result<HistorySecret>
Generate a new crate::HistorySecret.
This is useful when it’s this client’s turn to generate a new history client.
The generated secret is cryptographically unrelated to the current CoreCrypto client.
Sourcepub async fn is_history_sharing_enabled(&self) -> bool
pub async fn is_history_sharing_enabled(&self) -> bool
Check if history sharing is enabled, i.e., if any of the conversation members have a ClientId starting with crate::HISTORY_CLIENT_ID_PREFIX.
Source§impl Conversation
impl Conversation
pub const fn new( id: ConversationId, group: RwLock<MlsGroup>, configuration: ConversationConfiguration, session: Session, ) -> Conversation
Source§impl Conversation
impl Conversation
Sourcepub fn id(&self) -> &ConversationIdRef
pub fn id(&self) -> &ConversationIdRef
Returns the conversation’s ID
Sourcepub async fn group(&self) -> RwLockReadGuard<'_, MlsGroup>
pub async fn group(&self) -> RwLockReadGuard<'_, MlsGroup>
Returns an immutable guard over the underlying MLS group
Sourcepub fn configuration(&self) -> &ConversationConfiguration
pub fn configuration(&self) -> &ConversationConfiguration
Returns the conversation’s configuration
Sourcepub fn cipher_suite(&self) -> CipherSuite
pub fn cipher_suite(&self) -> CipherSuite
Returns this conversation’s cipher suite
Sourcepub async fn credential_ref(&self) -> Result<CredentialRef>
pub async fn credential_ref(&self) -> Result<CredentialRef>
Returns a reference to the credential used in this conversation
Sourcepub async fn export_secret_key(&self, key_length: usize) -> Result<SecretKey>
pub async fn export_secret_key(&self, key_length: usize) -> Result<SecretKey>
Sourcepub async fn get_external_sender(&self) -> Result<ExternalSenderKey>
pub async fn get_external_sender(&self) -> Result<ExternalSenderKey>
Returns the raw public key of the first external sender present in this group.
This should be used to initialize a subconversation
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Conversation
impl !RefUnwindSafe for Conversation
impl Send for Conversation
impl Sync for Conversation
impl Unpin for Conversation
impl UnsafeUnpin for Conversation
impl !UnwindSafe for Conversation
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