pub enum StringSession {
V1(FullSession),
V2(Session),
}Variants§
V1(FullSession)
V2(Session)
Implementations§
Source§impl StringSession
impl StringSession
Sourcepub fn decode(s: &str) -> Result<Self, StringSessionError>
pub fn decode(s: &str) -> Result<Self, StringSessionError>
Decode a string session. Auto-detects V1 or V2 from the version byte.
Sourcepub fn encode_v1(&self) -> String
pub fn encode_v1(&self) -> String
Encode as V1 (full session with salt, seq_no, layer). Use this for manual transfer or when full state is needed.
pub fn session(&self) -> Session
pub fn full_session(&self) -> Option<&FullSession>
pub fn version(&self) -> u8
Trait Implementations§
Source§impl Clone for StringSession
impl Clone for StringSession
Source§fn clone(&self) -> StringSession
fn clone(&self) -> StringSession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StringSession
impl Debug for StringSession
Source§impl From<FullSession> for StringSession
impl From<FullSession> for StringSession
Source§fn from(s: FullSession) -> Self
fn from(s: FullSession) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StringSession
impl RefUnwindSafe for StringSession
impl Send for StringSession
impl Sync for StringSession
impl Unpin for StringSession
impl UnsafeUnpin for StringSession
impl UnwindSafe for StringSession
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