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

pub enum ItemKind {
    ExternCrate(Option<Name>),
    Use(P<UseTree>),
    Static(P<Ty>, MutabilityP<Expr>),
    Const(P<Ty>, P<Expr>),
    Fn(P<FnDecl>, FnHeaderGenericsP<Block>),
    Mod(Mod),
    ForeignMod(ForeignMod),
    GlobalAsm(P<GlobalAsm>),
    Ty(P<Ty>, Generics),
    Existential(GenericBoundsGenerics),
    Enum(EnumDefGenerics),
    Struct(VariantDataGenerics),
    Union(VariantDataGenerics),
    Trait(IsAutoUnsafetyGenericsGenericBoundsVec<TraitItem>),
    TraitAlias(GenericsGenericBounds),
    Impl(UnsafetyImplPolarityDefaultnessGenericsOption<TraitRef>, P<Ty>, Vec<ImplItem>),
    Mac(Mac),
    MacroDef(MacroDef),
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Variants

ExternCrate(Option<Name>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

An extern crate item, with optional original crate name if the crate was renamed.

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

Use(P<UseTree>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A static item (static or pub static).

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

Const(P<Ty>, P<Expr>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A constant item (const or pub const).

E.g., const FOO: i32 = 42;.

Fn(P<FnDecl>, FnHeaderGenericsP<Block>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A function declaration (fn or pub fn).

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

Mod(Mod)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A module declaration (mod or pub mod).

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

ForeignMod(ForeignMod)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

An external module (extern or pub extern).

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

GlobalAsm(P<GlobalAsm>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

Ty(P<Ty>, Generics)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A type alias (type or pub type).

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

Existential(GenericBoundsGenerics)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

An existential type declaration (existential type).

E.g., existential type Foo: Bar + Boo;.

Enum(EnumDefGenerics)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

An enum definition (enum or pub enum).

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

Struct(VariantDataGenerics)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A struct definition (struct or pub struct).

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

Union(VariantDataGenerics)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A union definition (union or pub union).

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

Trait(IsAutoUnsafetyGenericsGenericBoundsVec<TraitItem>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A Trait declaration (trait or pub trait).

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

TraitAlias(GenericsGenericBounds)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Trait alias

E.g., trait Foo = Bar + Quux;.

Impl(UnsafetyImplPolarityDefaultnessGenericsOption<TraitRef>, P<Ty>, Vec<ImplItem>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

An implementation.

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

Mac(Mac)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A macro invocation.

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

MacroDef(MacroDef)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A macro definition.

Methods

impl ItemKind[src]

pub fn descriptive_variant(&self) -> &str[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Trait Implementations

impl Clone for ItemKind[src]

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

Performs copy-assignment from source. Read more

impl Debug for ItemKind[src]

impl Encodable for ItemKind[src]

impl Decodable for ItemKind[src]

Auto Trait Implementations

impl !Send for ItemKind

impl !Sync for ItemKind

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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> Encodable for T where
    T: UseSpecializedEncodable + ?Sized
[src]

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

impl<E> SpecializationError for E[src]

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

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

impl<T> Erased for T[src]