Struct vodozemac::megolm::InboundGroupSession
source · [−]pub struct InboundGroupSession { /* private fields */ }
Implementations
sourceimpl InboundGroupSession
impl InboundGroupSession
pub fn new(key: &SessionKey) -> Self
pub fn import(session_key: &ExportedSessionKey) -> Self
pub fn session_id(&self) -> String
pub fn first_known_index(&self) -> u32
sourcepub fn advance_to(&mut self, index: u32) -> bool
pub fn advance_to(&mut self, index: u32) -> bool
Permanently advance the session to the given index.
This will remove the ability to decrypt messages that were encrypted with a lower message index than what is given as the argument.
Returns true if the ratchet has been advanced, false if the ratchet was already advanced past the given index.
pub fn decrypt(
&mut self,
message: &MegolmMessage
) -> Result<DecryptedMessage, DecryptionError>
pub fn export_at(&mut self, index: u32) -> Option<ExportedSessionKey>
pub fn export_at_first_known_index(&self) -> ExportedSessionKey
sourcepub fn pickle(&self) -> InboundGroupSessionPickle
pub fn pickle(&self) -> InboundGroupSessionPickle
Convert the inbound group session into a struct which implements
serde::Serialize
and serde::Deserialize
.
sourcepub fn from_pickle(pickle: InboundGroupSessionPickle) -> Self
pub fn from_pickle(pickle: InboundGroupSessionPickle) -> Self
Restore an InboundGroupSession
from a previously saved
InboundGroupSessionPickle
.
pub fn from_libolm_pickle(
pickle: &str,
pickle_key: &[u8]
) -> Result<Self, LibolmPickleError>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for InboundGroupSession
impl<'de> Deserialize<'de> for InboundGroupSession
sourcefn 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
sourceimpl From<&GroupSession> for InboundGroupSession
impl From<&GroupSession> for InboundGroupSession
sourcefn from(session: &GroupSession) -> Self
fn from(session: &GroupSession) -> Self
Converts to this type from the input type.
sourceimpl From<&InboundGroupSession> for InboundGroupSessionPickle
impl From<&InboundGroupSession> for InboundGroupSessionPickle
sourcefn from(session: &InboundGroupSession) -> Self
fn from(session: &InboundGroupSession) -> Self
Converts to this type from the input type.
sourceimpl From<InboundGroupSessionPickle> for InboundGroupSession
impl From<InboundGroupSessionPickle> for InboundGroupSession
sourcefn from(pickle: InboundGroupSessionPickle) -> Self
fn from(pickle: InboundGroupSessionPickle) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for InboundGroupSession
impl Send for InboundGroupSession
impl Sync for InboundGroupSession
impl Unpin for InboundGroupSession
impl UnwindSafe for InboundGroupSession
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more