Struct napi::bindgen_prelude::CallbackInfo
source · [−]pub struct CallbackInfo<const N: usize> {
pub this: napi_value,
pub args: [napi_value; N],
/* private fields */
}
Fields
this: napi_value
args: [napi_value; N]
Implementations
sourceimpl<const N: usize> CallbackInfo<N>
impl<const N: usize> CallbackInfo<N>
pub fn new(
env: napi_env,
callback_info: napi_callback_info,
required_argc: Option<usize>
) -> Result<Self>
pub fn get_arg(&self, index: usize) -> napi_value
pub fn this(&self) -> napi_value
pub fn construct<T: 'static>(&self, js_name: &str, obj: T) -> Result<napi_value>
pub fn construct_generator<T: Generator + 'static>(
&self,
js_name: &str,
obj: T
) -> Result<napi_value>
pub fn factory<T: 'static>(&self, js_name: &str, obj: T) -> Result<napi_value>
pub fn generator_factory<T: Generator + 'static>(
&self,
js_name: &str,
obj: T
) -> Result<napi_value>
pub fn unwrap_borrow_mut<T>(&mut self) -> Result<&'static mut T> where
T: FromNapiMutRef + TypeName,
pub fn unwrap_borrow<T>(&mut self) -> Result<&'static T> where
T: FromNapiRef + TypeName,
Auto Trait Implementations
impl<const N: usize> RefUnwindSafe for CallbackInfo<N>
impl<const N: usize> !Send for CallbackInfo<N>
impl<const N: usize> !Sync for CallbackInfo<N>
impl<const N: usize> Unpin for CallbackInfo<N>
impl<const N: usize> UnwindSafe for CallbackInfo<N>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more