Expand description
This crate contains an SDK that is used to execute specially-
Re-exports§
pub use error::HyperlightError;
pub use metrics::set_metrics_registry;
pub use sandbox::is_hypervisor_present;
pub use sandbox::uninitialized::GuestBinary;
pub use sandbox::MultiUseSandbox;
pub use sandbox::SandboxRunOptions;
pub use sandbox::UninitializedSandbox;
pub use crate::func::call_ctx::MultiUseGuestCallContext;
Modules§
- error
- Dealing with errors, including errors across VM boundaries
- func
- Wrappers for host and guest functions.
- hypervisor
- Wrappers for hypervisor implementations
- mem
- Functionality to establish and manage an individual sandbox’s memory.
- metrics
- Metric definitions and helpers
- sandbox
- The main sandbox implementations. Do not use this module directly in code outside this file. Types from this module needed for public consumption are re-exported below.
- sandbox_
state trait
s and other functionality for dealing with defining sandbox states and moving between them
Macros§
- and
- Shorthand for chaining
SeccompCondition
s with theand
operator in aSeccompRule
. The rule will take theAllow
action if all the conditions are true. - debug
- Same as log::debug!, but will additionally print to stdout if the print_debug feature is enabled
- histogram_
observe - Observes a value for a Histogram
- histogram_
sample_ count - Gets the count of values of an Histogram or logs an error if the metric is not found Returns 0 if the metric is not found
- histogram_
sample_ sum - Gets the sum of values of an Histogram or logs an error if the metric is not found Returns 0.0 if the metric is not found
- histogram_
time_ micros - Observe the time it takes to execute an expression, record that time in microseconds in a Histogram and return the result of that expression
- histogram_
vec_ observe - Observes a value for a HistogramVec
- histogram_
vec_ sample_ count - Gets the count of values of an HistogramVec or logs an error if the metric is not found Returns 0 if the metric is not found
- histogram_
vec_ sample_ sum - Gets the sum of values of an HistogramVec or logs an error if the metric is not found Returns 0.0 if the metric is not found
- histogram_
vec_ time_ micros - Observe the time it takes to execute an expression, record that time in microseconds in a
HistogramVec
, and return the result of that expression - int_
counter_ get - Gets the value of an IntCounter or logs an error if the metric is not found
- int_
counter_ inc - Increments an IntCounter by 1 or logs an error if the metric is not found
- int_
counter_ inc_ by - Increments an IntCounter by a given value or logs an error if the metric is not found
- int_
counter_ reset - Resets an IntCounter or logs an error if the metric is not found
- int_
counter_ vec_ get - Gets the value of an IntCounterVec or logs an error if the metric is not found Returns 0 if the metric is not found
- int_
counter_ vec_ inc - Increments an IntCounterVec by 1 or logs an error if the metric is not found
- int_
counter_ vec_ inc_ by - Increments an IntCounterVec by a value or logs an error if the metric is not found
- int_
counter_ vec_ reset - Resets an IntCounterVec or logs an error if the metric is not found
- int_
gauge_ add - Adds a value to an IntGauge or logs an error if the metric is not found
- int_
gauge_ dec - Decrements an IntGauge by 1 or logs an error if the metric is not found
- int_
gauge_ get - Gets the value of an IntGauge logs an error and returns 0 if the metric is not found
- int_
gauge_ inc - Increments an IntGauge by 1 or logs an error if the metric is not found
- int_
gauge_ set - Sets an IntGauge to value or logs an error if the metric is not found
- int_
gauge_ sub - Subtracts a value from an IntGauge or logs an error if the metric is not found
- log_
then_ return - Logs an error then returns with it, more or less equivalent to the bail! macro in anyhow but for HyperlightError instead of anyhow::Error
- new_
error - Creates a
HyperlightError::Error
from a string literal or format string - or
- Shorthand for chaining
SeccompRule
s with theor
operator in aSeccompFilter
.
Type Aliases§
- Result
- The universal
Result
type used throughout the Hyperlight codebase.