Skip to main content

FromJS

Trait FromJS 

Source
pub trait FromJS: Sized {
    // Required method
    fn from_js(value: &JSValue, ctx: &JSContext) -> Option<Self>;
}

Required Methods§

Source

fn from_js(value: &JSValue, ctx: &JSContext) -> Option<Self>

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 FromJS for bool

Source§

fn from_js(value: &JSValue, _ctx: &JSContext) -> Option<Self>

Source§

impl FromJS for f64

Source§

fn from_js(value: &JSValue, _ctx: &JSContext) -> Option<Self>

Source§

impl FromJS for i32

Source§

fn from_js(value: &JSValue, _ctx: &JSContext) -> Option<Self>

Source§

impl FromJS for i64

Source§

fn from_js(value: &JSValue, _ctx: &JSContext) -> Option<Self>

Source§

impl FromJS for ()

Source§

fn from_js(_value: &JSValue, _ctx: &JSContext) -> Option<Self>

Source§

impl FromJS for String

Source§

fn from_js(value: &JSValue, ctx: &JSContext) -> Option<Self>

Implementors§