pub enum OlmMessage {
Message(Message),
PreKey(PreKeyMessage),
}
Expand description
An enum over the different Olm message types.
Variants§
Implementations§
Source§impl OlmMessage
impl OlmMessage
Sourcepub fn from_type_and_ciphertext(
message_type: usize,
ciphertext: String,
) -> Result<Self, UnknownOlmMessageType>
pub fn from_type_and_ciphertext( message_type: usize, ciphertext: String, ) -> Result<Self, UnknownOlmMessageType>
Create an OlmMessage from a message type and the ciphertext.
§Arguments
-
message_type
- The type of the Olm message, 0 for a pre-key message, 1 for a normal one. -
ciphertext
- The encrypted ciphertext of the message.
Sourcepub fn to_tuple(self) -> (OlmMessageType, String)
pub fn to_tuple(self) -> (OlmMessageType, String)
Convert a OlmMessage into a tuple of the OlmMessageType and ciphertext string.
Trait Implementations§
Source§impl Clone for OlmMessage
impl Clone for OlmMessage
Source§fn clone(&self) -> OlmMessage
fn clone(&self) -> OlmMessage
Returns a duplicate 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 moreAuto 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