pub trait TryFromVariant: Sized {
// Required method
fn try_from_variant(v: Variant) -> Result<Self, Error>;
}Expand description
Trait for types that can be cast from a variant.
Unlike IntoVariant, this does not imply TryFrom<Variant>, due to
orphan rules.
Required Methods§
Sourcefn try_from_variant(v: Variant) -> Result<Self, Error>
fn try_from_variant(v: Variant) -> Result<Self, Error>
Try to cast the given variant to this type.
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.