Enum vodozemac::olm::OlmMessage
source · pub enum OlmMessage {
Normal(Message),
PreKey(PreKeyMessage),
}
Expand description
Enum over the different Olm message types.
Olm uses two types of messages. The underlying transport protocol must provide a means for recipients to distinguish between them.
OlmMessage
provides Serialize
and Deserialize
implementations
that are compatible with Matrix.
Variants§
Normal(Message)
A normal message, contains only the ciphertext and metadata to decrypt it.
PreKey(PreKeyMessage)
Implementations§
source§impl OlmMessage
impl OlmMessage
sourcepub fn from_parts(
message_type: usize,
ciphertext: &[u8],
) -> Result<Self, DecodeError>
pub fn from_parts( message_type: usize, ciphertext: &[u8], ) -> Result<Self, DecodeError>
Create an OlmMessage
from a message type and a ciphertext.
sourcepub const fn message_type(&self) -> MessageType
pub const fn message_type(&self) -> MessageType
Get the type of the message.
Trait Implementations§
source§impl Clone for OlmMessage
impl Clone for OlmMessage
source§fn clone(&self) -> OlmMessage
fn clone(&self) -> OlmMessage
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 OlmMessage
impl Debug for OlmMessage
source§impl<'de> Deserialize<'de> for OlmMessage
impl<'de> Deserialize<'de> for OlmMessage
source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Message> for OlmMessage
impl From<Message> for OlmMessage
source§impl From<PreKeyMessage> for OlmMessage
impl From<PreKeyMessage> for OlmMessage
source§fn from(m: PreKeyMessage) -> Self
fn from(m: PreKeyMessage) -> Self
Converts to this type from the input type.
source§impl PartialEq for OlmMessage
impl PartialEq for OlmMessage
source§fn eq(&self, other: &OlmMessage) -> bool
fn eq(&self, other: &OlmMessage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for OlmMessage
impl Serialize for OlmMessage
impl Eq for OlmMessage
impl StructuralPartialEq for OlmMessage
Auto Trait Implementations§
impl Freeze for OlmMessage
impl RefUnwindSafe for OlmMessage
impl Send for OlmMessage
impl Sync for OlmMessage
impl Unpin for OlmMessage
impl UnwindSafe for OlmMessage
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)