pub struct SessionHandle { /* private fields */ }Expand description
Thread-safe handle stored in Hyperlane Context allowing handlers to read and mutate the active session.
Implementations§
Source§impl SessionHandle
Inherent implementation of SessionHandle.
impl SessionHandle
Inherent implementation of SessionHandle.
Sourcepub fn insert<K, V>(&self, key: K, value: V)
pub fn insert<K, V>(&self, key: K, value: V)
Inserts or updates a session attribute and marks the session dirty for persistence.
§Arguments
K- Attribute key convertible intoString.V- Attribute value convertible intoString.
Sourcepub fn regenerate_id(&self) -> String
pub fn regenerate_id(&self) -> String
Mints a fresh unpredictable session ID (session-fixation defense) and marks the session dirty.
§Returns
String- Newly generated session identifier.
Trait Implementations§
Source§impl Clone for SessionHandle
impl Clone for SessionHandle
Auto Trait Implementations§
impl Forget for SessionHandle
impl Freeze for SessionHandlewhere
*const ArcInner<SessionHandleInner> is !null: Freeze,
PhantomData<ArcInner<SessionHandleInner>>: Freeze,
impl Move for SessionHandle
impl RefUnwindSafe for SessionHandlewhere
Atomic<usize>: RefUnwindSafe,
Atomic<bool>: RefUnwindSafe,
Mutex<SessionState>: RefUnwindSafe,
impl Send for SessionHandle
impl Sync for SessionHandle
impl Unpin for SessionHandle
impl UnsafeUnpin for SessionHandlewhere
*const ArcInner<SessionHandleInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<SessionHandleInner>>: UnsafeUnpin,
impl UnwindSafe for SessionHandlewhere
Arc<SessionHandleInner>: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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