pub trait TryFromVal<E: Env, V: ?Sized>: Sized {
type Error: Debug + Into<Error>;
// Required method
fn try_from_val(env: &E, v: &V) -> Result<Self, Self::Error>;
}
Expand description
Trait for types that can be fallibly converted to another type V
, analogous
to the standard Rust type TryFrom
, but making use of the provided Env
implementation E
in order to convert parts of the type that require it.
Mainly this exists because Val
types that contain object handles need to
delegate to the environment to look up and extract the content of those
handles.
Required Associated Types§
Required Methods§
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.