Trait ExtractArgFromJs

Source
pub trait ExtractArgFromJs<'a>: Sized {
    // Required method
    fn convert_arg_at(
        js_cb: &'a JsCallback,
        index: usize,
    ) -> Result<Self, NjError>;

    // Provided method
    fn label() -> &'static str { ... }
}

Required Methods§

Source

fn convert_arg_at(js_cb: &'a JsCallback, index: usize) -> Result<Self, NjError>

convert js callback argument at index

Provided Methods§

Source

fn label() -> &'static str

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.

Implementations on Foreign Types§

Source§

impl<'a, T> ExtractArgFromJs<'a> for Option<T>
where T: JSValue<'a>,

Source§

fn label() -> &'static str

Source§

fn convert_arg_at( js_cb: &'a JsCallback, index: usize, ) -> Result<Option<T>, NjError>

Implementors§

Source§

impl ExtractArgFromJs<'_> for JsEnv

Source§

impl<'a, T> ExtractArgFromJs<'a> for T
where T: JSValue<'a>,