pub struct Client { /* private fields */ }
Expand description
An MLS client used to create key packages and manage groups.
See mls_rs::Client
for details.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(
id: Vec<u8>,
signature_keypair: SignatureKeypair,
client_config: ClientConfig,
) -> Self
pub fn new( id: Vec<u8>, signature_keypair: SignatureKeypair, client_config: ClientConfig, ) -> Self
Create a new client.
The user is identified by id
, which will be used to create a
basic credential together with the signature keypair.
See mls_rs::Client::builder
for details.
Sourcepub fn generate_key_package_message(&self) -> Result<Message, Error>
pub fn generate_key_package_message(&self) -> Result<Message, Error>
Generate a new key package for this client.
The key package is represented in is MLS message form. It is needed when joining a group and can be published to a server so other clients can look it up.
See mls_rs::Client::generate_key_package_message
for
details.
pub fn signing_identity(&self) -> Result<Arc<SigningIdentity>, Error>
Sourcepub fn create_group(&self, group_id: Option<Vec<u8>>) -> Result<Group, Error>
pub fn create_group(&self, group_id: Option<Vec<u8>>) -> Result<Group, Error>
Create and immediately join a new group.
If a group ID is not given, the underlying library will create a unique ID for you.
See mls_rs::Client::create_group
and
mls_rs::Client::create_group_with_id
for details.
Sourcepub fn join_group(
&self,
ratchet_tree: Option<RatchetTree>,
welcome_message: &Message,
) -> Result<JoinInfo, Error>
pub fn join_group( &self, ratchet_tree: Option<RatchetTree>, welcome_message: &Message, ) -> Result<JoinInfo, Error>
Join an existing group.
You must supply ratchet_tree
if the client that created
welcome_message
did not set use_ratchet_tree_extension
.
See mls_rs::Client::join_group
for details.
Sourcepub fn load_group(&self, group_id: Vec<u8>) -> Result<Group, Error>
pub fn load_group(&self, group_id: Vec<u8>) -> Result<Group, Error>
Load an existing group.
See mls_rs::Client::load_group
for details.
Trait Implementations§
Source§impl<T> LowerReturn<T> for Client
impl<T> LowerReturn<T> for Client
const TYPE_ID_META: MetadataBuffer
Source§type ReturnType = <Client as FfiConverterArc<UniFfiTag>>::FfiType
type ReturnType = <Client as FfiConverterArc<UniFfiTag>>::FfiType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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