pub trait TryCastJsInto<T>where
T: TryCastFromJs,{
type Error: From<Error>;
// Required methods
fn try_into_cast(&self) -> Result<Cast<'_, T>, Self::Error>;
fn try_into_owned(&self) -> Result<T, Self::Error>;
}Expand description
Inverse of TryCastFromJs, allowing a source value (such as a JsValue)
to be cast into a target Rust type T that implements TryCastFromJs.
Required Associated Types§
Required Methods§
Sourcefn try_into_cast(&self) -> Result<Cast<'_, T>, Self::Error>
fn try_into_cast(&self) -> Result<Cast<'_, T>, Self::Error>
Attempt to cast self into a Cast wrapping the target type T.
Sourcefn try_into_owned(&self) -> Result<T, Self::Error>
fn try_into_owned(&self) -> Result<T, Self::Error>
Attempt to cast self into an owned value of the target type T.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".