Enum syntax::ast::ItemKind [] [src]

pub enum ItemKind {
    ExternCrate(Option<Name>),
    Use(P<UseTree>),
    Static(P<Ty>, MutabilityP<Expr>),
    Const(P<Ty>, P<Expr>),
    Fn(P<FnDecl>, UnsafetySpanned<Constness>, AbiGenericsP<Block>),
    Mod(Mod),
    ForeignMod(ForeignMod),
    GlobalAsm(P<GlobalAsm>),
    Ty(P<Ty>, Generics),
    Enum(EnumDefGenerics),
    Struct(VariantDataGenerics),
    Union(VariantDataGenerics),
    Trait(IsAutoUnsafetyGenericsTyParamBoundsVec<TraitItem>),
    TraitAlias(GenericsTyParamBounds),
    Impl(UnsafetyImplPolarityDefaultnessGenericsOption<TraitRef>, P<Ty>, Vec<ImplItem>),
    Mac(Mac),
    MacroDef(MacroDef),
}

Variants

An extern crate item, with optional original crate name.

E.g. extern crate foo or extern crate foo_bar as foo

A use declaration (use or pub use) item.

E.g. use foo;, use foo::bar; or use foo::bar as FooBar;

A static item (static or pub static).

E.g. static FOO: i32 = 42; or static FOO: &'static str = "bar";

A constant item (const or pub const).

E.g. const FOO: i32 = 42;

A function declaration (fn or pub fn).

E.g. fn foo(bar: usize) -> usize { .. }

A module declaration (mod or pub mod).

E.g. mod foo; or mod foo { .. }

An external module (extern or pub extern).

E.g. extern {} or extern "C" {}

Module-level inline assembly (from global_asm!())

A type alias (type or pub type).

E.g. type Foo = Bar<u8>;

An enum definition (enum or pub enum).

E.g. enum Foo<A, B> { C<A>, D<B> }

A struct definition (struct or pub struct).

E.g. struct Foo<A> { x: A }

A union definition (union or pub union).

E.g. union Foo<A, B> { x: A, y: B }

A Trait declaration (trait or pub trait).

E.g. trait Foo { .. }, trait Foo<T> { .. } or auto trait Foo {}

Trait alias

E.g. trait Foo = Bar + Quux;

An implementation.

E.g. impl<A> Foo<A> { .. } or impl<A> Trait for Foo<A> { .. }

A macro invocation.

E.g. macro_rules! foo { .. } or foo!(..)

A macro definition.

Methods

impl ItemKind
[src]

[src]

Trait Implementations

impl Clone for ItemKind
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for ItemKind
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for ItemKind
[src]

impl Encodable for ItemKind
[src]

[src]

impl Decodable for ItemKind
[src]

[src]

impl Hash for ItemKind
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for ItemKind
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !Send for ItemKind

impl !Sync for ItemKind