Type Definition syntax::ast::NestedMetaItem [−][src]
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]
pub fn meta_item(&self) -> Option<&MetaItem>
Returns the MetaItem if self is a NestedMetaItemKind::MetaItem.
pub fn literal(&self) -> Option<&Lit>
[src]
pub fn literal(&self) -> Option<&Lit>
Returns the Lit if self is a NestedMetaItemKind::Literal.
pub fn span(&self) -> Span
[src]
pub fn span(&self) -> Span
Returns the Span for self
.
pub fn check_name(&self, name: &str) -> bool
[src]
pub fn check_name(&self, name: &str) -> bool
Returns true if this list item is a MetaItem with a name of name
.
pub fn name(&self) -> Option<Name>
[src]
pub fn name(&self) -> Option<Name>
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]
pub fn value_str(&self) -> Option<Symbol>
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]
pub fn name_value_literal(&self) -> Option<(Name, &Lit)>
Returns a name and single literal value tuple of the MetaItem.
pub fn word(&self) -> Option<&MetaItem>
[src]
pub fn word(&self) -> Option<&MetaItem>
Returns a MetaItem if self is a MetaItem with Kind Word.
pub fn meta_item_list(&self) -> Option<&[NestedMetaItem]>
[src]
pub fn meta_item_list(&self) -> Option<&[NestedMetaItem]>
Gets a list of inner meta items from a list MetaItem type.
pub fn is_meta_item(&self) -> bool
[src]
pub fn is_meta_item(&self) -> bool
Returns true
if the variant is MetaItem.
pub fn is_literal(&self) -> bool
[src]
pub fn is_literal(&self) -> bool
Returns true
if the variant is Literal.
pub fn is_word(&self) -> bool
[src]
pub fn is_word(&self) -> bool
Returns true
if self is a MetaItem and the meta item is a word.
pub fn is_value_str(&self) -> bool
[src]
pub fn is_value_str(&self) -> bool
Returns true
if self is a MetaItem and the meta item is a ValueString.
pub fn is_meta_item_list(&self) -> bool
[src]
pub fn is_meta_item_list(&self) -> bool
Returns true
if self is a MetaItem and the meta item is a list.