Skip to main content

hyperlight_common/func/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025 The Hyperlight Authors.
3
4/// Error types related to function support
5pub(crate) mod error;
6/// Definitions and functionality to enable guest-to-host function calling,
7/// also called "host functions"
8///
9/// This module includes functionality to do the following
10///
11/// - Define several prototypes for what a host function must look like,
12///   including the number of arguments (arity) they can have, supported argument
13///   types, and supported return types
14/// - Registering host functions to be callable by the guest
15/// - Dynamically dispatching a call from the guest to the appropriate
16///   host function
17pub(crate) mod functions;
18/// Definitions and functionality for supported parameter types
19pub(crate) mod param_type;
20/// Definitions and functionality for supported return types
21pub(crate) mod ret_type;
22
23pub use error::Error;
24/// Re-export for `HostFunction` trait
25pub use functions::Function;
26pub use param_type::{ParameterTuple, SupportedParameterType};
27pub use ret_type::{ResultType, SupportedReturnType};
28
29/// Re-export for `ParameterValue` enum
30pub use crate::flatbuffer_wrappers::function_types::ParameterValue;
31/// Re-export for `ReturnType` enum
32pub use crate::flatbuffer_wrappers::function_types::ReturnType;
33/// Re-export for `ReturnType` enum
34pub use crate::flatbuffer_wrappers::function_types::ReturnValue;
35
36mod utils;