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
impl SessionKernel
Sourcepub fn create_provider_filesystem(
&mut self,
handle: FilesystemHandle,
) -> SessionMountId
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
impl SessionKernel
Source§impl SessionKernel
impl SessionKernel
pub fn new() -> Self
Sourcepub fn new_with_native_engine(engine: NativeEngine) -> Self
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.
pub fn set_test_runner(&mut self, runner: &str) -> Result<(), String>
Sourcepub fn set_execution_backend(&mut self, backend: &str) -> Result<(), String>
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.
Sourcepub fn register_source_catalog(&mut self, catalog: &SourceCatalog)
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.
Sourcepub fn configure_native_source_cache(
&mut self,
root: &Path,
source_index_fingerprint: [u8; 32],
)
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.
Sourcepub fn install_bytecode_bundle(&mut self, bytes: &[u8]) -> Result<(), String>
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.
pub fn create_session(&mut self, id: SessionId) -> Result<(), String>
pub fn session_names(&self) -> Vec<SessionId>
pub fn session(&self, id: &SessionId) -> Result<&Session, String>
pub fn session_mut(&mut self, id: &SessionId) -> Result<&mut Session, String>
pub fn session_namespace(&self, id: &SessionId) -> Result<String, String>
pub fn native_execution_telemetry( &self, id: &SessionId, ) -> Result<NativeExecutionTelemetry, String>
pub fn eval(&mut self, id: &SessionId, source: &str) -> Result<String, String>
pub fn register_resource(&mut self, name: &str, source: &str)
pub fn remove_resource(&mut self, name: &str) -> bool
pub fn resource_names(&self) -> Vec<String>
pub fn register_bundle( &mut self, digest: &str, bytes: &[u8], ) -> Result<(), String>
pub fn bundle(&self, digest: &str) -> Option<&[u8]>
pub fn create_memory_filesystem(&mut self, root: &str) -> SessionMountId
pub fn create_native_filesystem(&mut self, root: &str) -> SessionMountId
pub fn attach_filesystem( &mut self, session: &SessionId, mount_id: SessionMountId, ) -> Result<(), String>
pub fn detach_filesystem(&mut self, session: &SessionId) -> Result<(), String>
pub fn filesystem(&self, session: &SessionId) -> Option<SessionMountId>
pub fn filesystem_info( &self, mount_id: SessionMountId, ) -> Result<(&str, &str, usize), String>
pub fn close_filesystem( &mut self, mount_id: SessionMountId, ) -> Result<(), String>
pub fn close_session(&mut self, id: &SessionId) -> Result<(), String>
§impl SessionKernel
impl SessionKernel
pub fn instrumentation(
&self,
id: &SessionId,
) -> Result<NativeInstrumentation, NativeInstrumentationError>
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
impl SessionKernel
pub fn register_sandbox_provider(&mut self, provider: Rc<dyn SandboxProvider>)
pub fn open_sandbox( &mut self, spec: SandboxSpec, ) -> Result<SandboxId, SandboxError>
pub fn sandbox_eval( &mut self, id: SandboxId, source: &str, ) -> Result<SandboxPending<String>, SandboxError>
pub fn sandbox_call( &mut self, id: SandboxId, callable: &str, arguments_hta: &[u8], ) -> Result<SandboxPending<Vec<u8>>, SandboxError>
pub fn cancel_sandbox(&mut self, id: SandboxId) -> Result<bool, SandboxError>
pub fn cancel_sandbox_evaluation( &mut self, id: SandboxId, evaluation: EvaluationId, ) -> Result<bool, SandboxError>
pub fn sandbox_status( &self, id: SandboxId, ) -> Result<SandboxStatus, SandboxError>
pub fn close_sandbox(&mut self, id: SandboxId) -> Result<(), SandboxError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SessionKernel
impl !Send for SessionKernel
impl !Sync for SessionKernel
impl !UnwindSafe for SessionKernel
impl Freeze for SessionKernel
impl Unpin for SessionKernel
impl UnsafeUnpin for SessionKernel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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