darling_core::options

Trait ParseAttribute

Source
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§

Source

fn parse_nested(&mut self, mi: &Meta) -> Result<()>

Read a meta-item, and apply its values to the current instance.

Provided Methods§

Source

fn parse_attributes(self, attrs: &[Attribute]) -> Result<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.

Implementors§