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§
Sourcefn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>
fn try_from_js(value: &JsValue, context: &mut Context) -> JsResult<Self>
This function tries to convert a JavaScript value into Self.
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.