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