[−][src]Type Definition syntax::ast::NestedMetaItem
type NestedMetaItem = Spanned<NestedMetaItemKind>;
A spanned compile-time attribute list item.
Methods
impl NestedMetaItem
[src]
impl NestedMetaItem
pub fn meta_item(&self) -> Option<&MetaItem> | [src] |
Returns the MetaItem if self is a NestedMetaItemKind::MetaItem.
pub fn literal(&self) -> Option<&Lit> | [src] |
Returns the Lit if self is a NestedMetaItemKind::Literal.
pub fn span(&self) -> Span | [src] |
Returns the Span for self
.
pub fn check_name(&self, name: &str) -> bool | [src] |
Returns true if this list item is a MetaItem with a name of name
.
pub fn name(&self) -> Option<Name> | [src] |
Returns the name of the meta item, e.g., foo
in #[foo]
,
#[foo="bar"]
and #[foo(bar)]
, if self is a MetaItem
pub fn value_str(&self) -> Option<Symbol> | [src] |
Gets the string value if self is a MetaItem and the MetaItem is a MetaItemKind::NameValue variant containing a string, otherwise None.
pub fn name_value_literal(&self) -> Option<(Name, &Lit)> | [src] |
Returns a name and single literal value tuple of the MetaItem.
pub fn word(&self) -> Option<&MetaItem> | [src] |
Returns a MetaItem if self is a MetaItem with Kind Word.
pub fn meta_item_list(&self) -> Option<&[NestedMetaItem]> | [src] |
Gets a list of inner meta items from a list MetaItem type.
pub fn is_meta_item(&self) -> bool | [src] |
Returns true
if the variant is MetaItem.
pub fn is_literal(&self) -> bool | [src] |
Returns true
if the variant is Literal.
pub fn is_word(&self) -> bool | [src] |
Returns true
if self is a MetaItem and the meta item is a word.
pub fn is_value_str(&self) -> bool | [src] |
Returns true
if self is a MetaItem and the meta item is a ValueString.
pub fn is_meta_item_list(&self) -> bool | [src] |
Returns true
if self is a MetaItem and the meta item is a list.