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
sandboxmodule 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::Errorfrom a string literal or format string
Structs§
- File
Metadata - Module resolution and loading functionality. Metadata information about a file
- File
System Embedded - 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.
- LoadedJS
Sandbox - 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.
- ProtoJS
Sandbox - 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.
- Sandbox
Builder - A builder for creating a new
JSSandboxA builder for a ProtoJSSandbox - Sandbox
Configuration - 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§
- Resolve
Error - Module resolution and loading functionality. All resolution errors
Traits§
- File
System - Module resolution and loading functionality.
File System abstraction used for
ResolverGeneric - Interrupt
Handle - 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§
- Host
Print Fn - The function to pass to a new
JSSandboxto tell it how to handle guest requests to print some output. - Hyperlight
Error - The error type for Hyperlight operations
- Parameter
Value - The container to store the value of a single parameter to a guest function.
- Result
- The Result of a function call
- Return
Type - The type of the return value from a guest function call.
- Return
Value - The container to store the return value from a guest function call.