pub trait FromVariant: Sized + StaticVariantType {
// Required method
fn from_variant(variant: &Variant) -> Option<Self>;
}
Expand description
Extracts a value.
Required Methods§
Sourcefn from_variant(variant: &Variant) -> Option<Self>
fn from_variant(variant: &Variant) -> Option<Self>
Tries to extract a value.
Returns Some
if the variant’s type matches 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.