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 JSVal
s.
Required Methods§
sourceunsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)
Convert self
to a JSVal
. JSAPI failure causes a panic.