[][src]Struct nj_core::val::JsCallback

pub struct JsCallback { /* fields omitted */ }

Implementations

impl JsCallback[src]

pub fn new(env: JsEnv, this: napi_value, args: Vec<napi_value>) -> Self[src]

pub fn env(&self) -> &JsEnv[src]

pub fn args(&self, index: usize) -> napi_value[src]

pub fn this(&self) -> napi_value[src]

pub fn this_owned(self) -> napi_value[src]

pub fn remove_napi(&mut self) -> Option<napi_value>[src]

pub fn get_value<'a, T>(&'a mut self) -> Result<T, NjError> where
    T: ExtractFromJs<'a>, 
[src]

consume next napi value and remove them from arg list

pub fn get_value_at<'a, T>(&'a self, index: usize) -> Result<T, NjError> where
    T: ExtractArgFromJs<'a>, 
[src]

convert value to rust

pub fn create_thread_safe_function(
    &mut self,
    name: &str,
    call_js_cb: napi_threadsafe_function_call_js
) -> Result<ThreadSafeFunction, NjError>
[src]

create thread safe function

pub fn create_thread_safe_function_at(
    &self,
    name: &str,
    index: usize,
    call_js_cb: napi_threadsafe_function_call_js
) -> Result<ThreadSafeFunction, NjError>
[src]

create thread safe function at

pub fn unwrap_mut<T>(&self) -> Result<&'static mut T, NjError>[src]

pub fn unwrap<T>(&self) -> Result<&'static T, NjError>[src]

Trait Implementations

impl Clone for JsCallback[src]

impl Send for JsCallback[src]

impl Sync for JsCallback[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.