pub trait HostFn: Send + Sync {
// Required method
fn call(
&self,
cx: HostCallContext,
input: Value,
) -> BoxFuture<'static, Result<Value, HostJsError>>;
}Expand description
One function of a host library. Any
Fn(HostCallContext, Value) -> impl Future<Output = Result<Value, HostJsError>>
is one.
Required Methods§
fn call( &self, cx: HostCallContext, input: Value, ) -> BoxFuture<'static, Result<Value, HostJsError>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".