Skip to main content

SessionKernel

Struct SessionKernel 

Source
pub struct SessionKernel { /* private fields */ }
Expand description

A process-local kernel that multiplexes isolated evaluator sessions.

Raw HTA exposes the same lifecycle over its wire targets; this native facade keeps embedding hosts from treating a Runtime as the process boundary when several independent sessions can share one kernel.

Implementations§

Source§

impl SessionKernel

Source

pub fn create_provider_filesystem( &mut self, handle: FilesystemHandle, ) -> SessionMountId

Creates a Kernel-owned mount from an already-opened provider-neutral filesystem capability. Existing attach/detach/close accounting remains authoritative; the adapter supplies only the runtime dispatch seam.

Source§

impl SessionKernel

Source

pub fn work_host(&self) -> WorkHost

Return the process/evaluator-thread work host shared by every session.

Source§

impl SessionKernel

Source

pub fn new() -> Self

Source

pub fn new_with_native_engine(engine: NativeEngine) -> Self

Creates an isolated-session kernel with a shared direct-native program cache. The cache is useful for short-lived session owners such as the Hara test runner; no namespace or mutable value state is shared.

Source

pub fn set_test_runner(&mut self, runner: &str) -> Result<(), String>

Source

pub fn set_execution_backend(&mut self, backend: &str) -> Result<(), String>

Selects the ordinary evaluation backend for every existing and future session owned by this kernel.

Source

pub fn register_source_catalog(&mut self, catalog: &SourceCatalog)

Mounts a lazy native source catalog in every current session and carries it into sessions created later by this kernel.

Source

pub fn configure_native_source_cache( &mut self, root: &Path, source_index_fingerprint: [u8; 32], )

Enables the project-local direct-native source-program cache for every current session and for sessions created later by this kernel.

Source

pub fn install_bytecode_bundle(&mut self, bytes: &[u8]) -> Result<(), String>

Installs a verified HBX namespace bundle in every current session. Bundle loading is transactional per session and remains explicit so a kernel cannot accidentally make an application package available to a later session without the host opting into it.

Source

pub fn create_session(&mut self, id: SessionId) -> Result<(), String>

Source

pub fn session_names(&self) -> Vec<SessionId>

Source

pub fn session(&self, id: &SessionId) -> Result<&Session, String>

Source

pub fn session_mut(&mut self, id: &SessionId) -> Result<&mut Session, String>

Source

pub fn session_namespace(&self, id: &SessionId) -> Result<String, String>

Source

pub fn native_execution_telemetry( &self, id: &SessionId, ) -> Result<NativeExecutionTelemetry, String>

Source

pub fn eval(&mut self, id: &SessionId, source: &str) -> Result<String, String>

Source

pub fn register_resource(&mut self, name: &str, source: &str)

Source

pub fn remove_resource(&mut self, name: &str) -> bool

Source

pub fn resource_names(&self) -> Vec<String>

Source

pub fn register_bundle( &mut self, digest: &str, bytes: &[u8], ) -> Result<(), String>

Source

pub fn bundle(&self, digest: &str) -> Option<&[u8]>

Source

pub fn create_memory_filesystem(&mut self, root: &str) -> SessionMountId

Source

pub fn create_native_filesystem(&mut self, root: &str) -> SessionMountId

Source

pub fn attach_filesystem( &mut self, session: &SessionId, mount_id: SessionMountId, ) -> Result<(), String>

Source

pub fn detach_filesystem(&mut self, session: &SessionId) -> Result<(), String>

Source

pub fn filesystem(&self, session: &SessionId) -> Option<SessionMountId>

Source

pub fn filesystem_info( &self, mount_id: SessionMountId, ) -> Result<(&str, &str, usize), String>

Source

pub fn close_filesystem( &mut self, mount_id: SessionMountId, ) -> Result<(), String>

Source

pub fn close_session(&mut self, id: &SessionId) -> Result<(), String>

§

impl SessionKernel

pub fn instrumentation( &self, id: &SessionId, ) -> Result<NativeInstrumentation, NativeInstrumentationError>

Returns the embedding-only native instrumentation service owned by one active Session Runtime.

This host method does not install a Hara Var, grant guest authority, or add an ambient Runtime lookup. The returned service holds only a weak Runtime identity and becomes unusable when the Session closes.

Source§

impl SessionKernel

Source

pub fn register_sandbox_provider(&mut self, provider: Rc<dyn SandboxProvider>)

Source

pub fn open_sandbox( &mut self, spec: SandboxSpec, ) -> Result<SandboxId, SandboxError>

Source

pub fn sandbox_eval( &mut self, id: SandboxId, source: &str, ) -> Result<SandboxPending<String>, SandboxError>

Source

pub fn sandbox_call( &mut self, id: SandboxId, callable: &str, arguments_hta: &[u8], ) -> Result<SandboxPending<Vec<u8>>, SandboxError>

Source

pub fn cancel_sandbox(&mut self, id: SandboxId) -> Result<bool, SandboxError>

Source

pub fn cancel_sandbox_evaluation( &mut self, id: SandboxId, evaluation: EvaluationId, ) -> Result<bool, SandboxError>

Source

pub fn sandbox_status( &self, id: SandboxId, ) -> Result<SandboxStatus, SandboxError>

Source

pub fn close_sandbox(&mut self, id: SandboxId) -> Result<(), SandboxError>

Trait Implementations§

Source§

impl Default for SessionKernel

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more