Enum syn::ItemKind [] [src]

pub enum ItemKind {
    ExternCrate(Option<Ident>),
    Use(Box<ViewPath>),
    Static(Box<Ty>, MutabilityBox<Expr>),
    Const(Box<Ty>, Box<Expr>),
    Fn(Box<FnDecl>, UnsafetyConstnessOption<Abi>, GenericsBox<Block>),
    Mod(Option<Vec<Item>>),
    ForeignMod(ForeignMod),
    Ty(Box<Ty>, Generics),
    Enum(Vec<Variant>, Generics),
    Struct(VariantDataGenerics),
    Union(VariantDataGenerics),
    Trait(UnsafetyGenericsVec<TyParamBound>, Vec<TraitItem>),
    DefaultImpl(UnsafetyPath),
    Impl(UnsafetyImplPolarityGenericsOption<Path>, Box<Ty>, Vec<ImplItem>),
    Mac(Mac),
}

Variants

Anextern 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" {}

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 { .. } or trait Foo<T> { .. }

Default trait implementation.

E.g. impl Trait for .. {} or impl<T> Trait<T> for .. {}

An implementation.

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

A macro invocation (which includes macro definition).

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

Trait Implementations

impl Debug for ItemKind
[src]

[src]

Formats the value using the given formatter. Read more

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 Eq for ItemKind
[src]

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 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