pub struct SessionGuard<'a, V> { /* private fields */ }Expand description
A reference to a session variable of type V, returned by SessionExt::get and
SessionExt::get_opt.
It borrows the session’s current snapshot through an arc_swap::Guard, so reads never take a
lock or a full Arc clone. The guard is tied to the session borrow it was read from, so it is
meant to be used on the stack rather than stored in a long-lived data structure (holding it pins
an internal arc-swap slot, which can contend with concurrent writers). SessionGuard derefs to
V, so it can be used wherever a &V is expected.
Trait Implementations§
Source§impl<V: VortexSessionVar> Debug for SessionGuard<'_, V>
impl<V: VortexSessionVar> Debug for SessionGuard<'_, V>
Auto Trait Implementations§
impl<'a, V> !RefUnwindSafe for SessionGuard<'a, V>
impl<'a, V> !UnwindSafe for SessionGuard<'a, V>
impl<'a, V> Freeze for SessionGuard<'a, V>
impl<'a, V> Send for SessionGuard<'a, V>
impl<'a, V> Sync for SessionGuard<'a, V>
impl<'a, V> Unpin for SessionGuard<'a, V>
impl<'a, V> UnsafeUnpin for SessionGuard<'a, V>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
Source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load.