pub struct SessionMut<'a, V: VortexSessionVar> { /* private fields */ }Expand description
A copy-on-write mutable handle to a session variable of type V, returned by
SessionExt::get_mut.
It holds a private clone of the variable and exposes it through DerefMut. When the handle is
dropped, the (possibly mutated) value is re-inserted into the
session, replacing the previous one. Because the session stores each variable behind a shared
Arc observed by every clone, handing out a plain &mut to the stored value would be unsound;
this guard provides mutable access by cloning on read and publishing on drop instead.
Trait Implementations§
Source§impl<V: VortexSessionVar> Debug for SessionMut<'_, V>
impl<V: VortexSessionVar> Debug for SessionMut<'_, V>
Source§impl<V: VortexSessionVar> Deref for SessionMut<'_, V>
impl<V: VortexSessionVar> Deref for SessionMut<'_, V>
Source§impl<V: VortexSessionVar> DerefMut for SessionMut<'_, V>
impl<V: VortexSessionVar> DerefMut for SessionMut<'_, V>
Source§impl<V: VortexSessionVar> Drop for SessionMut<'_, V>
impl<V: VortexSessionVar> Drop for SessionMut<'_, V>
Auto Trait Implementations§
impl<'a, V> !RefUnwindSafe for SessionMut<'a, V>
impl<'a, V> !UnwindSafe for SessionMut<'a, V>
impl<'a, V> Freeze for SessionMut<'a, V>where
V: Freeze,
impl<'a, V> Send for SessionMut<'a, V>
impl<'a, V> Sync for SessionMut<'a, V>
impl<'a, V> Unpin for SessionMut<'a, V>where
V: Unpin,
impl<'a, V> UnsafeUnpin for SessionMut<'a, V>where
V: UnsafeUnpin,
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.