Struct vodozemac::megolm::ExportedSessionKey
source · pub struct ExportedSessionKey { /* private fields */ }
Expand description
The exported session key.
This uses the same format as the SessionKey
minus the signature at the
end.
Implementations§
source§impl ExportedSessionKey
impl ExportedSessionKey
sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, SessionKeyDecodeError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, SessionKeyDecodeError>
Deserialize the ExportedSessionKey
from a byte slice.
sourcepub fn to_base64(&self) -> String
pub fn to_base64(&self) -> String
Serialize the ExportedSessionKey
to a base64 encoded string.
This method will first use the ExportedSessionKey::to_bytes()
to
convert the session key to a byte vector and then encode the byte vector
to a string using unpadded base64 as the encoding.
sourcepub fn from_base64(key: &str) -> Result<Self, SessionKeyDecodeError>
pub fn from_base64(key: &str) -> Result<Self, SessionKeyDecodeError>
Deserialize the ExportedSessionKey
from base64 encoded string.
Trait Implementations§
source§impl<'de> Deserialize<'de> for ExportedSessionKey
impl<'de> Deserialize<'de> for ExportedSessionKey
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 Drop for ExportedSessionKey
impl Drop for ExportedSessionKey
source§impl Serialize for ExportedSessionKey
impl Serialize for ExportedSessionKey
source§impl TryFrom<&[u8]> for ExportedSessionKey
impl TryFrom<&[u8]> for ExportedSessionKey
source§impl TryFrom<&str> for ExportedSessionKey
impl TryFrom<&str> for ExportedSessionKey
Auto Trait Implementations§
impl Freeze for ExportedSessionKey
impl RefUnwindSafe for ExportedSessionKey
impl Send for ExportedSessionKey
impl Sync for ExportedSessionKey
impl Unpin for ExportedSessionKey
impl UnwindSafe for ExportedSessionKey
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