hyperlight_common/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/// Error types related to function support
18pub(crate) mod error;
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 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
36pub use error::Error;
37/// Re-export for `HostFunction` trait
38pub use functions::Function;
39pub use param_type::{ParameterTuple, SupportedParameterType};
40pub use ret_type::{ResultType, SupportedReturnType};
41
42/// Re-export for `ParameterValue` enum
43pub use crate::flatbuffer_wrappers::function_types::ParameterValue;
44/// Re-export for `ReturnType` enum
45pub use crate::flatbuffer_wrappers::function_types::ReturnType;
46/// Re-export for `ReturnType` enum
47pub use crate::flatbuffer_wrappers::function_types::ReturnValue;
48
49mod utils;