Struct syntax::ast::Item [−][src]
pub struct Item { pub ident: Ident, pub attrs: Vec<Attribute>, pub id: NodeId, pub node: ItemKind, pub vis: Visibility, pub span: Span, pub tokens: Option<TokenStream>, }
An item
The name might be a dummy name in case of anonymous items
Fields
ident: Ident
attrs: Vec<Attribute>
id: NodeId
node: ItemKind
vis: Visibility
span: Span
tokens: Option<TokenStream>
Original tokens this item was parsed from. This isn't necessarily
available for all items, although over time more and more items should
have this be Some
. Right now this is primarily used for procedural
macros, notably custom attributes.
Note that the tokens here do not include the outer attributes, but will include inner attributes.
Trait Implementations
impl Clone for Item
[src]
impl Clone for Item
fn clone(&self) -> Item
[src]
fn clone(&self) -> Item
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Encodable for Item
[src]
impl Encodable for Item
impl Decodable for Item
[src]
impl Decodable for Item
impl Debug for Item
[src]
impl Debug for Item
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl HasAttrs for Item
[src]
impl HasAttrs for Item