Enum syntex_syntax::ast::ItemKind [] [src]

pub enum ItemKind {
    ExternCrate(Option<Name>),
    Use(P<ViewPath>),
    Static(P<Ty>, MutabilityP<Expr>),
    Const(P<Ty>, P<Expr>),
    Fn(P<FnDecl>, UnsafetyConstnessAbiGenericsP<Block>),
    Mod(Mod),
    ForeignMod(ForeignMod),
    Ty(P<Ty>, Generics),
    Enum(EnumDefGenerics),
    Struct(VariantDataGenerics),
    Trait(UnsafetyGenericsTyParamBoundsVec<TraitItem>),
    DefaultImpl(UnsafetyTraitRef),
    Impl(UnsafetyImplPolarityGenericsOption<TraitRef>, P<Ty>, Vec<ImplItem>),
    Mac(Mac),
}

Variants

ExternCrate(Option<Name>)

Anextern crate item, with optional original crate name.

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

Use(P<ViewPath>)

A use declaration (use or pub use) item.

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

Static(P<Ty>, MutabilityP<Expr>)

A static item (static or pub static).

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

Const(P<Ty>, P<Expr>)

A constant item (const or pub const).

E.g. const FOO: i32 = 42;

Fn(P<FnDecl>, UnsafetyConstnessAbiGenericsP<Block>)

A function declaration (fn or pub fn).

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

Mod(Mod)

A module declaration (mod or pub mod).

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

ForeignMod(ForeignMod)

An external module (extern or pub extern).

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

Ty(P<Ty>, Generics)

A type alias (type or pub type).

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

Enum(EnumDefGenerics)

An enum definition (enum or pub enum).

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

Struct(VariantDataGenerics)

A struct definition (struct or pub struct).

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

Trait(UnsafetyGenericsTyParamBoundsVec<TraitItem>)

A Trait declaration (trait or pub trait).

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

DefaultImpl(UnsafetyTraitRef)

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

Impl(UnsafetyImplPolarityGenericsOption<TraitRef>, P<Ty>, Vec<ImplItem>)

An implementation.

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

Mac(Mac)

A macro invocation (which includes macro definition).

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

Methods

impl ItemKind
[src]

fn descriptive_variant(&self) -> &str

Trait Implementations

impl Debug for ItemKind
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Hash for ItemKind
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl Decodable for ItemKind
[src]

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<ItemKind, __D::Error>

impl Encodable for ItemKind
[src]

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl Eq for ItemKind
[src]

impl PartialEq for ItemKind
[src]

fn eq(&self, __arg_0: &ItemKind) -> bool

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

fn ne(&self, __arg_0: &ItemKind) -> bool

This method tests for !=.

impl Clone for ItemKind
[src]

fn clone(&self) -> ItemKind

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more