Trait HostFunction4

Source
pub trait HostFunction4<'a, P1, P2, P3, P4, R>
where P1: SupportedParameterType<P1> + Clone + 'a, P2: SupportedParameterType<P2> + Clone + 'a, P3: SupportedParameterType<P3> + Clone + 'a, P4: SupportedParameterType<P4> + 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§

Source

fn register(&self, sandbox: &mut UninitializedSandbox, name: &str) -> Result<()>

Register the host function with the given name in the sandbox.

Source

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.

Implementations on Foreign Types§

Source§

impl<'a, T, P1, P2, P3, P4, R> HostFunction4<'a, P1, P2, P3, P4, R> for Arc<Mutex<T>>
where T: FnMut(P1, P2, P3, P4) -> Result<R> + Send + 'static, P1: SupportedParameterType<P1> + Clone + 'a, P2: SupportedParameterType<P2> + Clone + 'a, P3: SupportedParameterType<P3> + Clone + 'a, P4: SupportedParameterType<P4> + Clone + 'a, R: SupportedReturnType<R>,

Source§

fn register(&self, sandbox: &mut UninitializedSandbox, name: &str) -> Result<()>

Source§

fn register_with_extra_allowed_syscalls( &self, sandbox: &mut UninitializedSandbox, name: &str, extra_allowed_syscalls: Vec<ExtraAllowedSyscall>, ) -> Result<()>

Implementors§