[][src]Struct syntax::ast::Item

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: Identattrs: Vec<Attribute>id: NodeIdnode: ItemKindvis: Visibilityspan: Spantokens: 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.

Methods

impl Item[src]

pub fn span_with_attributes(&self) -> Span[src]

Return the span that encompasses the attributes.

Trait Implementations

impl HasAttrs for Item[src]

impl Clone for Item[src]

impl Debug for Item[src]

impl Encodable for Item[src]

impl Decodable for Item[src]

Auto Trait Implementations

impl Unpin for Item

impl !Sync for Item

impl !Send for Item

impl !UnwindSafe for Item

impl !RefUnwindSafe for Item

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> Encodable for T where
    T: UseSpecializedEncodable + ?Sized
[src]

impl<T> Decodable for T where
    T: UseSpecializedDecodable
[src]

impl<E> SpecializationError for E[src]