Skip to main content

Crate hyperlight_js

Crate hyperlight_js 

Source
Expand description

This crate provides a Hyperlight implementation for JavaScript guest code.

Re-exports§

pub use sandbox::monitor;
pub use sandbox::monitor::ExecutionMonitor;
pub use sandbox::monitor::MonitorSet;

Modules§

sandbox
Sandbox module containing all sandbox-related types The sandbox module contains the sandbox types for the Hyperlight JavaScript runtime.

Macros§

embed_modules
Macro to create an embedded file system with compile-time included modules.
new_error
Create a generic HyperlightError Creates a HyperlightError::Error from a string literal or format string

Structs§

FileMetadata
Module resolution and loading functionality. Metadata information about a file
FileSystemEmbedded
Module resolution and loading functionality. File system implementation that uses embedded modules compiled into the binary.
JSSandbox
A Hyperlight Sandbox with a JavaScript run time loaded but no guest code. A Hyperlight Sandbox with a JavaScript run time loaded but no guest code.
LoadedJSSandbox
A Hyperlight Sandbox with a JavaScript run time loaded and guest code loaded. A Hyperlight Sandbox with a JavaScript run time loaded and guest JavaScript handlers loaded.
ProtoJSSandbox
A Hyperlight Sandbox with no JavaScript run time loaded and no guest code. This is used to register new host functions prior to loading the JavaScript runtime. A Hyperlight Sandbox with no JavaScript run time loaded and no guest code. This is used to register new host functions prior to loading the JavaScript run time.
SandboxBuilder
A builder for creating a new JSSandbox A builder for a ProtoJSSandbox
SandboxConfiguration
Configuration for sandbox resource limits and behavior. The complete set of configuration needed to create a Sandbox
Script
Types for working with JS script. Represents a JavaScript immutable handler script with metadata about its source location. The source location metadata is required to resolve relative locations when the script imports other modules using relative paths.
Snapshot
A snapshot of sandbox state that can be used to restore it later. A snapshot capturing the state of the memory in a MultiUseSandbox.

Enums§

ResolveError
Module resolution and loading functionality. All resolution errors

Traits§

FileSystem
Module resolution and loading functionality. File System abstraction used for ResolverGeneric
InterruptHandle
A handle to interrupt guest code execution A trait for handling interrupts to a sandbox’s vcpu

Functions§

is_hypervisor_present
Check if there is a hypervisor present Determine whether a suitable hypervisor is available to run this sandbox.

Type Aliases§

HostPrintFn
The function to pass to a new JSSandbox to tell it how to handle guest requests to print some output.
HyperlightError
The error type for Hyperlight operations
ParameterValue
The container to store the value of a single parameter to a guest function.
Result
The Result of a function call
ReturnType
The type of the return value from a guest function call.
ReturnValue
The container to store the return value from a guest function call.