pub trait FromVariant: Sized {
// Required method
fn from_variant(variant: &Variant) -> Result<Self, Error>;
}
Expand description
Creates an instance from a specified syn::Variant
.
Required Methods§
Sourcefn from_variant(variant: &Variant) -> Result<Self, Error>
fn from_variant(variant: &Variant) -> Result<Self, Error>
Create an instance from syn::Variant
, or return an error.
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.