hyperlight_host/func/mod.rs
1/*
2Copyright 2025 The Hyperlight Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17/// Functionality to check for errors after a guest call
18pub(crate) mod guest_err;
19/// Definitions and functionality to enable guest-to-host function calling,
20/// also called "host functions"
21///
22/// This module includes functionality to do the following
23///
24/// - Define several prototypes for what a host function must look like,
25/// including the number of arguments (arity) they can have, supported argument
26/// types, and supported return types
27/// - Registering host functions to be callable by the guest
28/// - Dynamically dispatching a call from the guest to the appropriate
29/// host function
30pub(crate) mod host_functions;
31/// Definitions and functionality for supported parameter types
32pub(crate) mod param_type;
33/// Definitions and functionality for supported return types
34pub(crate) mod ret_type;
35
36/// Re-export for `HostFunction` trait
37pub use host_functions::{HostFunction, Registerable};
38/// Re-export for `ParameterValue` enum
39pub use hyperlight_common::flatbuffer_wrappers::function_types::ParameterValue;
40/// Re-export for `ReturnType` enum
41pub use hyperlight_common::flatbuffer_wrappers::function_types::ReturnType;
42/// Re-export for `ReturnType` enum
43pub use hyperlight_common::flatbuffer_wrappers::function_types::ReturnValue;
44pub use param_type::{ParameterTuple, SupportedParameterType};
45pub use ret_type::{ResultType, SupportedReturnType};
46
47mod utils;