Trait FromVal

Source
pub trait FromVal: Sized {
    // Required methods
    fn from_val(v: &Val) -> Self;
    fn take_ownership(v: Handle) -> Self;
    fn as_handle(&self) -> Handle;
}

Required Methods§

Source

fn from_val(v: &Val) -> Self

Creates a Val object from another

Source

fn take_ownership(v: Handle) -> Self

Takes the ownership of a handle

Source

fn as_handle(&self) -> Handle

Returns the raw js handle

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 FromVal for Option<&str>

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for Option<String>

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for bool

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for f32

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for f64

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for i8

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for i16

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for i32

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for i64

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for isize

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for u8

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for u16

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for u32

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for u64

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Source§

impl FromVal for usize

Source§

fn from_val(v: &Val) -> Self

Source§

fn take_ownership(v: Handle) -> Self

Source§

fn as_handle(&self) -> Handle

Implementors§