pub struct VortexSession(/* private fields */);Expand description
A Vortex session encapsulates the set of extensible arrays, layouts, compute functions, dtypes, etc. that are available for use in a given context.
It is also the entry-point passed to dynamic libraries to initialize Vortex plugins.
Cloning a session is cheap and shares the backing store: a variable registered through one
clone (via VortexSession::with_some or one of the with_* helpers) is observed by all
clones. To build an independent session, start from VortexSession::empty.
Implementations§
Source§impl VortexSession
impl VortexSession
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Create a new VortexSession with no session state.
Sourcepub fn register<V: VortexSessionVar>(&self, var: V)
pub fn register<V: VortexSessionVar>(&self, var: V)
Inserts a session variable of type V, unconditionally replacing any existing variable of
that type.
This replaces the whole value; it does not merge changes into the previous value. Existing
SessionGuards keep observing their pinned snapshot, while new reads see the replacement.
Variables that expose shared mutable state must synchronize it in their own API.
with_some and get_or_insert_with
use ArcSwapMap::insert_if_absent so
that a first registration cannot overwrite another.
Sourcepub fn with<V: VortexSessionVar + Default>(self) -> Self
pub fn with<V: VortexSessionVar + Default>(self) -> Self
Inserts a new session variable of type V with its default value, mutating this session in
place and returning it for chaining.
The change is applied copy-on-write to the shared backing store, so it is observed through every clone of this session.
§Panics
If a variable of that type already exists.
Sourcepub fn with_some<V: VortexSessionVar>(self, var: V) -> Self
pub fn with_some<V: VortexSessionVar>(self, var: V) -> Self
Inserts a new session variable of type V, mutating this session in place and returning it
for chaining.
The change is applied copy-on-write to the shared backing store, so it is observed through every clone of this session.
§Panics
If a variable of that type already exists.
Sourcepub fn allows_unknown(&self) -> bool
pub fn allows_unknown(&self) -> bool
Returns whether unknown plugins should deserialize as foreign placeholders.
Sourcepub fn allow_unknown(&self)
pub fn allow_unknown(&self)
Allow deserializing unknown plugin IDs as non-executable foreign placeholders.
Sets the policy to allow unknown plugin IDs.
Trait Implementations§
Source§impl Clone for VortexSession
impl Clone for VortexSession
Source§impl Debug for VortexSession
impl Debug for VortexSession
Source§impl SessionExt for VortexSession
impl SessionExt for VortexSession
Source§fn session(&self) -> VortexSession
fn session(&self) -> VortexSession
VortexSession.Source§fn get<V: VortexSessionVar + Default>(&self) -> SessionGuard<'_, V>
fn get<V: VortexSessionVar + Default>(&self) -> SessionGuard<'_, V>
V, inserting a default one if it does not exist. Read moreSource§fn get_or_insert_with<V: VortexSessionVar>(
&self,
init: impl FnOnce() -> V,
) -> SessionGuard<'_, V>
fn get_or_insert_with<V: VortexSessionVar>( &self, init: impl FnOnce() -> V, ) -> SessionGuard<'_, V>
V, inserting the result of init if it does not
exist. Read moreSource§fn get_opt<V: VortexSessionVar>(&self) -> Option<SessionGuard<'_, V>>
fn get_opt<V: VortexSessionVar>(&self) -> Option<SessionGuard<'_, V>>
V if it exists.