Struct mls_rs::MlsMessage
source · 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 into_group_info(self) -> Option<GroupInfo>
pub fn as_group_info(&self) -> Option<&GroupInfo>
pub fn into_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
StateUpdate::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§fn eq(&self, other: &MlsMessage) -> bool
fn eq(&self, other: &MlsMessage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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