@@ -29,7 +29,13 @@ use crate::{new_error, Result};
29
29
#[ derive( Default , Clone ) ]
30
30
/// A Wrapper around details of functions exposed by the Host
31
31
pub struct HostFuncsWrapper {
32
- functions_map : HashMap < String , ( HyperlightFunction , Option < Vec < ExtraAllowedSyscall > > ) > ,
32
+ functions_map : HashMap < String , FunctionEntry > ,
33
+ }
34
+
35
+ #[ derive( Clone ) ]
36
+ pub struct FunctionEntry {
37
+ pub function : HyperlightFunction ,
38
+ pub extra_allowed_syscalls : Option < Vec < ExtraAllowedSyscall > > ,
33
39
}
34
40
35
41
impl HostFuncsWrapper {
@@ -86,7 +92,7 @@ impl HostFuncsWrapper {
86
92
fn register_host_function_helper (
87
93
& mut self ,
88
94
name : String ,
89
- func : HyperlightFunction ,
95
+ function : HyperlightFunction ,
90
96
extra_allowed_syscalls : Option < Vec < ExtraAllowedSyscall > > ,
91
97
) -> Result < ( ) > {
92
98
#[ cfg( not( all( feature = "seccomp" , target_os = "linux" ) ) ) ]
@@ -95,8 +101,13 @@ impl HostFuncsWrapper {
95
101
"Extra syscalls are only supported on Linux with seccomp"
96
102
) ) ;
97
103
}
98
- self . functions_map
99
- . insert ( name, ( func, extra_allowed_syscalls) ) ;
104
+ self . functions_map . insert (
105
+ name,
106
+ FunctionEntry {
107
+ function,
108
+ extra_allowed_syscalls,
109
+ } ,
110
+ ) ;
100
111
Ok ( ( ) )
101
112
}
102
113
0 commit comments