Trait boa_engine::value::TryFromJs

source ·
pub trait TryFromJs: Sized {
    // Required method
    fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>;
}
Expand description

This trait adds a fallible and efficient conversions from a JsValue to Rust types.

Required Methods§

source

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

This function tries to convert a JavaScript value into Self.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TryFromJs for bool

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for f64

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for i8

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for i16

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for i32

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for i64

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for i128

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for u8

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for u16

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for u32

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for u64

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for u128

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for usize

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for String

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl TryFromJs for BigInt

source§

fn try_from_js(value: &JsValue, _context: &mut Context) -> JsResult<Self>

source§

impl<A: TryFromJs> TryFromJs for (A,)

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<A: TryFromJs, B: TryFromJs> TryFromJs for (A, B)

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<A: TryFromJs, B: TryFromJs, C: TryFromJs> TryFromJs for (A, B, C)

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<A: TryFromJs, B: TryFromJs, C: TryFromJs, D: TryFromJs> TryFromJs for (A, B, C, D)

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<A: TryFromJs, B: TryFromJs, C: TryFromJs, D: TryFromJs, E: TryFromJs> TryFromJs for (A, B, C, D, E)

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<A: TryFromJs, B: TryFromJs, C: TryFromJs, D: TryFromJs, E: TryFromJs, F: TryFromJs> TryFromJs for (A, B, C, D, E, F)

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<A: TryFromJs, B: TryFromJs, C: TryFromJs, D: TryFromJs, E: TryFromJs, F: TryFromJs, G: TryFromJs> TryFromJs for (A, B, C, D, E, F, G)

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<A: TryFromJs, B: TryFromJs, C: TryFromJs, D: TryFromJs, E: TryFromJs, F: TryFromJs, G: TryFromJs, H: TryFromJs> TryFromJs for (A, B, C, D, E, F, G, H)

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<A: TryFromJs, B: TryFromJs, C: TryFromJs, D: TryFromJs, E: TryFromJs, F: TryFromJs, G: TryFromJs, H: TryFromJs, I: TryFromJs> TryFromJs for (A, B, C, D, E, F, G, H, I)

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<A: TryFromJs, B: TryFromJs, C: TryFromJs, D: TryFromJs, E: TryFromJs, F: TryFromJs, G: TryFromJs, H: TryFromJs, I: TryFromJs, J: TryFromJs> TryFromJs for (A, B, C, D, E, F, G, H, I, J)

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<K, V> TryFromJs for BTreeMap<K, V>
where K: TryFromJs + Ord, V: TryFromJs,

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<K, V, S> TryFromJs for HashMap<K, V, S>
where K: TryFromJs + Ord + Hash, V: TryFromJs, S: BuildHasher + Default,

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<L, R> TryFromJs for Either<L, R>
where L: TryFromJs, R: TryFromJs,

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<T> TryFromJs for Option<T>
where T: TryFromJs,

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

source§

impl<T> TryFromJs for Vec<T>
where T: TryFromJs,

source§

fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>

Implementors§