@@ -29,7 +29,13 @@ use crate::{new_error, Result};
2929#[ derive( Default , Clone ) ]
3030/// A Wrapper around details of functions exposed by the Host
3131pub 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 > > ,
3339}
3440
3541impl HostFuncsWrapper {
@@ -86,7 +92,7 @@ impl HostFuncsWrapper {
8692 fn register_host_function_helper (
8793 & mut self ,
8894 name : String ,
89- func : HyperlightFunction ,
95+ function : HyperlightFunction ,
9096 extra_allowed_syscalls : Option < Vec < ExtraAllowedSyscall > > ,
9197 ) -> Result < ( ) > {
9298 #[ cfg( not( all( feature = "seccomp" , target_os = "linux" ) ) ) ]
@@ -95,8 +101,13 @@ impl HostFuncsWrapper {
95101 "Extra syscalls are only supported on Linux with seccomp"
96102 ) ) ;
97103 }
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+ ) ;
100111 Ok ( ( ) )
101112 }
102113
0 commit comments