Trait mozjs::conversions::ToJSValConvertible

source ·
pub trait ToJSValConvertible {
    // Required method
    unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>);
}
Expand description

A trait to convert Rust types to JSVals.

Required Methods§

source

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

Convert self to a JSVal. JSAPI failure causes a panic.

Implementations on Foreign Types§

source§

impl ToJSValConvertible for bool

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for f32

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for f64

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for i8

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for i16

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for i32

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for i64

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for *mut Symbol

source§

unsafe fn to_jsval(&self, _: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for *mut JSObject

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for str

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for u8

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for u16

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for u32

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for u64

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for ()

source§

unsafe fn to_jsval(&self, _cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for String

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl ToJSValConvertible for NonNull<JSObject>

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl<T: ToJSValConvertible> ToJSValConvertible for Option<T>

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl<T: ToJSValConvertible> ToJSValConvertible for &T

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl<T: ToJSValConvertible> ToJSValConvertible for [T]

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl<T: ToJSValConvertible> ToJSValConvertible for Box<T>

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl<T: ToJSValConvertible> ToJSValConvertible for Rc<T>

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

source§

impl<T: ToJSValConvertible> ToJSValConvertible for Vec<T>

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

Implementors§