pub struct MlsMessage { /* private fields */ }
Expand description
A MLS protocol message for sending data over the wire.
Implementations§
Source§impl MlsMessage
impl MlsMessage
pub fn description(&self) -> MlsMessageDescription<'_>
Source§impl MlsMessage
impl MlsMessage
pub fn into_group_info(self) -> Option<GroupInfo>
pub fn as_group_info(&self) -> Option<&GroupInfo>
pub fn into_key_package(self) -> Option<KeyPackage>
pub fn as_key_package(&self) -> Option<&KeyPackage>
Sourcepub fn wire_format(&self) -> WireFormat
pub fn wire_format(&self) -> WireFormat
The wire format value describing the contents of this message.
Sourcepub fn epoch(&self) -> Option<u64>
pub fn epoch(&self) -> Option<u64>
The epoch that this message belongs to.
Returns None
if the message is WireFormat::KeyPackage
or WireFormat::Welcome
pub fn cipher_suite(&self) -> Option<CipherSuite>
pub fn group_id(&self) -> Option<&[u8]>
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, MlsError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, MlsError>
Deserialize a message from transport.
Sourcepub fn custom_proposals_by_value(&self) -> Vec<&CustomProposal>
pub fn custom_proposals_by_value(&self) -> Vec<&CustomProposal>
If this is a plaintext commit message, return all custom proposals committed by value. If this is not a plaintext or not a commit, this returns an empty list.
Sourcepub fn welcome_key_package_references(&self) -> Vec<&KeyPackageRef>
pub fn welcome_key_package_references(&self) -> Vec<&KeyPackageRef>
If this is a welcome message, return key package references of all members who can join using this message.
Sourcepub fn key_package_reference<C: CipherSuiteProvider>(
&self,
cipher_suite: &C,
) -> Result<Option<KeyPackageRef>, MlsError>
pub fn key_package_reference<C: CipherSuiteProvider>( &self, cipher_suite: &C, ) -> Result<Option<KeyPackageRef>, MlsError>
If this is a key package, return its key package reference.
Sourcepub fn into_proposal_reference<C: CipherSuiteProvider>(
self,
cipher_suite: &C,
) -> Result<Option<Vec<u8>>, MlsError>
pub fn into_proposal_reference<C: CipherSuiteProvider>( self, cipher_suite: &C, ) -> Result<Option<Vec<u8>>, MlsError>
If this is a plaintext proposal, return the proposal reference that can be matched e.g. with
NewEpoch::unused_proposals
.
Trait Implementations§
Source§impl Clone for MlsMessage
impl Clone for MlsMessage
Source§fn clone(&self) -> MlsMessage
fn clone(&self) -> MlsMessage
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MlsMessage
impl Debug for MlsMessage
Source§impl MlsDecode for MlsMessage
impl MlsDecode for MlsMessage
Source§impl MlsEncode for MlsMessage
impl MlsEncode for MlsMessage
Source§impl MlsSize for MlsMessage
impl MlsSize for MlsMessage
fn mls_encoded_len(&self) -> usize
Source§impl PartialEq for MlsMessage
impl PartialEq for MlsMessage
Source§impl TryFrom<MlsMessage> for AddProposal
impl TryFrom<MlsMessage> for AddProposal
impl StructuralPartialEq for MlsMessage
Auto Trait Implementations§
impl Freeze for MlsMessage
impl RefUnwindSafe for MlsMessage
impl Send for MlsMessage
impl Sync for MlsMessage
impl Unpin for MlsMessage
impl UnwindSafe for MlsMessage
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
Mutably borrows from an owned value. Read more
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>
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 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>
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