Skip to main content

Conversation

Struct Conversation 

Source
pub struct Conversation { /* private fields */ }
Expand description

A Conversation exposes the read-only interface of an MLS conversation.

Implementations§

Source§

impl Conversation

Source

pub async fn get_client_ids(&self) -> Vec<ClientId>

Exports the clients from a conversation

§Arguments
  • conversation_id - the group/conversation id
Source

pub async fn members_in_next_epoch(&self) -> Vec<ClientId>

Get actual group members and subtract pending remove proposals

Source§

impl Conversation

Source

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 client
  • epoch - current group epoch
  • nb_members - number of clients in the group
Source§

impl Conversation

Source

pub async fn members(&self) -> HashMap<Vec<u8>, MlsCredential>

Returns all members credentials from the group/conversation

Source

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

Source

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

Source

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

Source

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

Source

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.

Source

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

Source

pub const fn new( id: ConversationId, group: RwLock<MlsGroup>, configuration: ConversationConfiguration, session: Session, ) -> Conversation

Source§

impl Conversation

Source

pub fn id(&self) -> &ConversationIdRef

Returns the conversation’s ID

Source

pub async fn group(&self) -> RwLockReadGuard<'_, MlsGroup>

Returns an immutable guard over the underlying MLS group

Source

pub fn configuration(&self) -> &ConversationConfiguration

Returns the conversation’s configuration

Source

pub async fn epoch(&self) -> u64

Returns current epoch of the MLS group

Source

pub fn cipher_suite(&self) -> CipherSuite

Returns this conversation’s cipher suite

Source

pub async fn credential_ref(&self) -> Result<CredentialRef>

Returns a reference to the credential used in this conversation

Source

pub async fn export_secret_key(&self, key_length: usize) -> Result<SecretKey>

Derives a new key from the one in the group, to be used elsewhere.

§Arguments
  • key_length - the length of the key to be derived. If the value is higher than the bounds of u16 or the context hash * 255, an error will be returned
§Errors

OpenMls secret generation error

Source

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§

Source§

impl Debug for Conversation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T