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/// Definitions and functionality to enable guest-to-host function calling,
18/// also called "host functions"
19///
20/// This module includes functionality to do the following
21///
22/// - Define several prototypes for what a host function must look like,
23/// including the number of arguments (arity) they can have, supported argument
24/// types, and supported return types
25/// - Registering host functions to be callable by the guest
26/// - Dynamically dispatching a call from the guest to the appropriate
27/// host function
28pub(crate) mod host_functions;
29
30/// Re-export for `HostFunction` trait
31pub use host_functions::{HostFunction, Registerable};
32/// Re-export for `ParameterValue` enum
33pub use hyperlight_common::flatbuffer_wrappers::function_types::ParameterValue;
34/// Re-export for `ReturnType` enum
35pub use hyperlight_common::flatbuffer_wrappers::function_types::ReturnType;
36/// Re-export for `ReturnValue` enum
37pub use hyperlight_common::flatbuffer_wrappers::function_types::ReturnValue;
38pub use hyperlight_common::func::{
39 ParameterTuple, ResultType, SupportedParameterType, SupportedReturnType,
40};