Struct vodozemac::olm::SessionPickle
source · pub struct SessionPickle { /* private fields */ }
Expand description
A format suitable for serialization which implements serde::Serialize
and serde::Deserialize
. Obtainable by calling Session::pickle
.
Implementations§
source§impl SessionPickle
impl SessionPickle
sourcepub fn encrypt(self, pickle_key: &[u8; 32]) -> String
pub fn encrypt(self, pickle_key: &[u8; 32]) -> String
Serialize and encrypt the pickle using the given key.
This is the inverse of SessionPickle::from_encrypted
.
sourcepub fn from_encrypted(
ciphertext: &str,
pickle_key: &[u8; 32],
) -> Result<Self, PickleError>
pub fn from_encrypted( ciphertext: &str, pickle_key: &[u8; 32], ) -> Result<Self, PickleError>
Obtain a pickle from a ciphertext by decrypting and deserializing using the given key.
This is the inverse of SessionPickle::encrypt
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for SessionPickle
impl<'de> Deserialize<'de> for SessionPickle
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<SessionPickle> for Session
impl From<SessionPickle> for Session
source§fn from(pickle: SessionPickle) -> Self
fn from(pickle: SessionPickle) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SessionPickle
impl RefUnwindSafe for SessionPickle
impl Send for SessionPickle
impl Sync for SessionPickle
impl Unpin for SessionPickle
impl UnwindSafe for SessionPickle
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