Trait HostFunction0

Source
pub trait HostFunction0<'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 zero 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, R> HostFunction0<'a, R> for Arc<Mutex<T>>
where T: FnMut() -> Result<R> + Send + 'static, 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§