Trait syntax::attr::AttrMetaMethods[src]

pub trait AttrMetaMethods {
    fn name(&self) -> InternedString;
    fn value_str(&self) -> Option<InternedString>;
    fn meta_item_list<'a>(&'a self) -> Option<&'a [Gc<MetaItem>]>;

    fn check_name(&self, name: &str) -> bool { ... }
}

Required Methods

fn name(&self) -> InternedString

Retrieve the name of the meta item, e.g. foo in #[foo],

[foo="bar"] and #[foo(bar)]

fn value_str(&self) -> Option<InternedString>

Gets the string value if self is a MetaNameValue variant containing a string, otherwise None.

fn meta_item_list<'a>(&'a self) -> Option<&'a [Gc<MetaItem>]>

Gets a list of inner meta items from a list MetaItem type.

Provided Methods

fn check_name(&self, name: &str) -> bool

Implementors