pub trait UtilsExt {
// Required methods
fn console_log<V>(&self, args: &[V]) -> Result<()>
where V: NapiValue;
fn create_promise<Res>(
&self,
executor: Box<dyn FnOnce(Env, Box<dyn Fn(Res)>, Box<dyn Fn(Error)>) -> Result<()>>,
) -> Result<JsObject>
where Res: NapiValue + 'static;
}Required Methods§
Sourcefn console_log<V>(&self, args: &[V]) -> Result<()>where
V: NapiValue,
fn console_log<V>(&self, args: &[V]) -> Result<()>where
V: NapiValue,
Runs console.log() in the JavaScript context.
useful for debugging NapiValue types
fn create_promise<Res>(
&self,
executor: Box<dyn FnOnce(Env, Box<dyn Fn(Res)>, Box<dyn Fn(Error)>) -> Result<()>>,
) -> Result<JsObject>where
Res: NapiValue + 'static,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.