pub trait HostFunction2<'a, P1, P2, R>where
P1: SupportedParameterType<P1> + Clone + 'a,
P2: SupportedParameterType<P2> + Clone + 'a,
R: SupportedReturnType<R>,{
// Required methods
fn register(
&self,
sandbox: &mut UninitializedSandbox,
name: &str,
) -> Result<()>;
fn register_with_extra_allowed_syscalls(
&self,
sandbox: &mut UninitializedSandbox,
name: &str,
extra_allowed_syscalls: Vec<ExtraAllowedSyscall>,
) -> Result<()>;
}
Expand description
Trait for registering a host function with $N parameters.
Required Methods§
Sourcefn register(&self, sandbox: &mut UninitializedSandbox, name: &str) -> Result<()>
fn register(&self, sandbox: &mut UninitializedSandbox, name: &str) -> Result<()>
Register the host function with the given name in the sandbox.
Sourcefn register_with_extra_allowed_syscalls(
&self,
sandbox: &mut UninitializedSandbox,
name: &str,
extra_allowed_syscalls: Vec<ExtraAllowedSyscall>,
) -> Result<()>
fn register_with_extra_allowed_syscalls( &self, sandbox: &mut UninitializedSandbox, name: &str, extra_allowed_syscalls: Vec<ExtraAllowedSyscall>, ) -> Result<()>
Register the host function with the given name in the sandbox, allowing extra syscalls.