pub trait ParseAttribute: Sized {
// Required method
fn parse_nested(&mut self, mi: &Meta) -> Result<()>;
// Provided method
fn parse_attributes(self, attrs: &[Attribute]) -> Result<Self> { ... }
}
Expand description
Middleware for extracting attribute values. Implementers are expected to override
parse_nested
so they can apply individual items to themselves, while parse_attributes
is responsible for looping through distinct outer attributes and collecting errors.
Required Methods§
sourcefn parse_nested(&mut self, mi: &Meta) -> Result<()>
fn parse_nested(&mut self, mi: &Meta) -> Result<()>
Read a meta-item, and apply its values to the current instance.
Provided Methods§
fn parse_attributes(self, attrs: &[Attribute]) -> Result<Self>
Object Safety§
This trait is not object safe.