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)
Performs copy-assignment from source
. Read more
impl PartialEq for Item
[src]
impl PartialEq for Item
fn eq(&self, other: &Item) -> bool
[src]
fn eq(&self, other: &Item) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Item) -> bool
[src]
fn ne(&self, other: &Item) -> bool
This method tests for !=
.
impl Eq for Item
[src]
impl Eq for Item
impl Encodable for Item
[src]
impl Encodable for Item
impl Decodable for Item
[src]
impl Decodable for Item
impl Hash for Item
[src]
impl Hash for Item
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
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