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, replacing any existing variable of that type.
This is the copy-on-write insert primitive behind with_some and
get_mut; it is not public, so a variable can only enter the type-map
through those (or through a default inserted by get). The mutation is
applied in place to the shared backing store, so it is visible through every clone.
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.
Mutates this session in place and returns it for chaining.
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_opt<V: VortexSessionVar>(&self) -> Option<SessionGuard<'_, V>>
fn get_opt<V: VortexSessionVar>(&self) -> Option<SessionGuard<'_, V>>
V if it exists.Source§fn get_mut<V: VortexSessionVar + Default + Clone>(&self) -> SessionMut<'_, V>
fn get_mut<V: VortexSessionVar + Default + Clone>(&self) -> SessionMut<'_, V>
SessionMut handle for the variable of type V, inserting a
default one first if it does not exist. Read more