core_crypto::mls::conversation

Struct MlsConversation

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

This is a wrapper on top of the OpenMls’s MlsGroup, that provides Core Crypto specific functionality

This type will store the state of a group. With the MlsGroup it holds, it provides all operations that can be done in a group, such as creating proposals and commits. More information here

Implementations§

Source§

impl MlsConversation

Source

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

impl MlsConversation

Creating proposals

Source§

impl MlsConversation

Source

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 identifier
  • author_client - the client responsible for creating the group
  • creator_credential_type - kind of credential the creator wants to join the group with
  • config - group configuration
  • backend - MLS Provider that will be used to persist the group
§Errors

Errors can happen from OpenMls or from the KeyStore

Source

pub fn id(&self) -> &ConversationId

Group/conversation id

Source

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

Returns all members credentials from the group/conversation

Source

pub fn members_with_key(&self) -> HashMap<Vec<u8>, CredentialWithKey>

Returns all members credentials with their signature public key from the group/conversation

Source§

impl MlsConversation

Source

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

Get actual group members and subtract pending remove proposals

Trait Implementations§

Source§

impl Debug for MlsConversation

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