Skip to main content

hyperlight_host/func/
mod.rs

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