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) -> Result<Vec<ClientId>>
pub async fn get_client_ids(&self) -> Result<Vec<ClientId>>
Exports the clients from a conversation Does NOT include history client ids.
Sourcepub async fn get_history_client_ids(&self) -> Vec<Vec<u8>>
pub async fn get_history_client_ids(&self) -> Vec<Vec<u8>>
Exports the history client ids from a conversation
Sourcepub async fn members_in_next_epoch(&self) -> Result<Vec<ClientId>>
pub async fn members_in_next_epoch(&self) -> Result<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>
A deterministic delay, in seconds, which this client should wait before committing the conversation’s pending proposals.
The delay is derived from this client’s position in the ratchet tree and the current epoch, so that members of a group stagger their commits rather than racing to commit the same proposals.
Returns None in two cases, which callers have to distinguish:
- there are no pending proposals, so there is nothing to commit;
- a pending proposal removes this client, so it must not commit at all.
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,
) -> Result<HashMap<ClientId, CredentialWithKey>>
pub async fn members_with_key( &self, ) -> Result<HashMap<ClientId, 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.
An identity is returned for every requested member which is in the
conversation, whatever its credential type. Members with an X509
credential additionally carry a WireIdentity::x509_identity; members
with a basic credential do not, and their status is always Valid,
which on its own is no evidence of end-to-end identity enrolment.
Sourcepub async fn get_user_identities(
&self,
user_ids: &[Uuid],
) -> Result<HashMap<Uuid, Vec<WireIdentity>>>
pub async fn get_user_identities( &self, user_ids: &[Uuid], ) -> Result<HashMap<Uuid, Vec<WireIdentity>>>
From a given conversation, get the identity of the users (device holders) supplied.
As with Self::get_device_identities, an identity is returned for every device of every
requested user, whatever its credential type; only devices with an X509 credential carry a
WireIdentity::x509_identity.
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<MlsGroupState>, 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 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<ExternalSender>
pub async fn get_external_sender(&self) -> Result<ExternalSender>
Returns 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 !UnwindSafe for Conversation
impl Send for Conversation
impl Sync for Conversation
impl Unpin for Conversation
impl UnsafeUnpin 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
impl<T> ErasedDestructor for Twhere
T: 'static,
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