Skip to main content

SessionExt

Trait SessionExt 

Source
pub trait SessionExt: Sized + Sealed {
    // Required methods
    fn session(&self) -> VortexSession;
    fn get<V: SessionVar + Default>(&self) -> Ref<'_, V>;
    fn get_opt<V: SessionVar>(&self) -> Option<Ref<'_, V>>;
    fn get_mut<V: SessionVar + Default>(&self) -> RefMut<'_, V>;
    fn get_mut_opt<V: SessionVar>(&self) -> Option<RefMut<'_, V>>;
}
Expand description

Trait for accessing and modifying the state of a Vortex session.

Required Methods§

Source

fn session(&self) -> VortexSession

Returns the VortexSession.

Source

fn get<V: SessionVar + Default>(&self) -> Ref<'_, V>

Returns the scope variable of type V, or inserts a default one if it does not exist.

Source

fn get_opt<V: SessionVar>(&self) -> Option<Ref<'_, V>>

Returns the scope variable of type V if it exists.

Source

fn get_mut<V: SessionVar + Default>(&self) -> RefMut<'_, V>

Returns the scope variable of type V, or inserts a default one if it does not exist.

Note that the returned value internally holds a lock on the variable.

Source

fn get_mut_opt<V: SessionVar>(&self) -> Option<RefMut<'_, V>>

Returns the scope variable of type V, if it exists.

Note that the returned value internally holds a lock on the variable.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§