Trait JsCast

Source
pub trait JsCast
where Self: AsRef<JsValue> + Into<JsValue>,
{ // Required methods fn unchecked_from_js(val: JsValue) -> Self; fn unchecked_from_js_ref(val: &JsValue) -> &Self; // Provided methods fn unchecked_into<T>(self) -> T where T: JsCast { ... } fn unchecked_ref<T>(&self) -> &T where T: JsCast { ... } }
Expand description

For converting between JavaScript types.

Note that most class types generated by WSDOM also comes with Into and AsRef impls for converting to their ancestors in the inheritance chain.

Required Methods§

Provided Methods§

Source

fn unchecked_into<T>(self) -> T
where T: JsCast,

Source

fn unchecked_ref<T>(&self) -> &T
where T: JsCast,

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.

Implementors§