pub trait FromMeta: Sized {
// Required method
fn from_meta(meta: &MetaItem) -> Result<Self>;
// Provided methods
fn from_attr(attr: &Attribute) -> Result<Self> { ... }
fn from_attrs(name: &str, attrs: &[Attribute]) -> Result<Vec<Self>> { ... }
fn one_from_attrs(name: &str, attrs: &[Attribute]) -> Result<Option<Self>> { ... }
fn default() -> Option<Self> { ... }
}
Required Methods§
Provided Methods§
fn from_attr(attr: &Attribute) -> Result<Self>
fn from_attrs(name: &str, attrs: &[Attribute]) -> Result<Vec<Self>>
fn one_from_attrs(name: &str, attrs: &[Attribute]) -> Result<Option<Self>>
fn default() -> Option<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.