Trait from_attr::ParseMeta

source ·
pub trait ParseMeta {
    // Required methods
    fn is_unit() -> bool;
    fn parse_meta(&mut self, meta: ParseNestedMeta<'_>) -> Result<()>;

    // Provided methods
    fn parse_attr(&mut self, attr: &Attribute) -> Result<()> { ... }
    fn parse_meta_list(&mut self, meta_list: &MetaList) -> Result<()> { ... }
    fn parse_tokens(&mut self, tokens: TokenStream) -> Result<()> { ... }
}
Expand description

Used to enable parsing of each meta.

Generally an helper struct is generated from the derive macro FromAttr, and an implementation of the ParseMeta trait is generated on this struct.

Required Methods§

source

fn is_unit() -> bool

Whether the type is unit type.

source

fn parse_meta(&mut self, meta: ParseNestedMeta<'_>) -> Result<()>

Parse one meta.

Provided Methods§

source

fn parse_attr(&mut self, attr: &Attribute) -> Result<()>

Parse one Attribute.

source

fn parse_meta_list(&mut self, meta_list: &MetaList) -> Result<()>

Parse one MetaList.

source

fn parse_tokens(&mut self, tokens: TokenStream) -> Result<()>

Parse one TokenStream.

Object Safety§

This trait is not object safe.

Implementors§