Enum syntax::ast::ItemKind [−][src]
pub enum ItemKind {
ExternCrate(Option<Name>),
Use(P<UseTree>),
Static(P<Ty>, Mutability, P<Expr>),
Const(P<Ty>, P<Expr>),
Fn(P<FnDecl>, FnHeader, Generics, P<Block>),
Mod(Mod),
ForeignMod(ForeignMod),
GlobalAsm(P<GlobalAsm>),
Ty(P<Ty>, Generics),
Existential(GenericBounds, Generics),
Enum(EnumDef, Generics),
Struct(VariantData, Generics),
Union(VariantData, Generics),
Trait(IsAuto, Unsafety, Generics, GenericBounds, Vec<TraitItem>),
TraitAlias(Generics, GenericBounds),
Impl(Unsafety, ImplPolarity, Defaultness, Generics, Option<TraitRef>, P<Ty>, Vec<ImplItem>),
Mac(Mac),
MacroDef(MacroDef),
}🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Variants
ExternCrate(Option<Name>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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 a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A use declaration (use or pub use) item.
E.g. use foo;, use foo::bar; or use foo::bar as FooBar;
Static(P<Ty>, Mutability, P<Expr>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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 a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A constant item (const or pub const).
E.g. const FOO: i32 = 42;
Fn(P<FnDecl>, FnHeader, Generics, P<Block>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A function declaration (fn or pub fn).
E.g. fn foo(bar: usize) -> usize { .. }
Mod(Mod)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A module declaration (mod or pub mod).
E.g. mod foo; or mod foo { .. }
ForeignMod(ForeignMod)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
An external module (extern or pub extern).
E.g. extern {} or extern "C" {}
GlobalAsm(P<GlobalAsm>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Module-level inline assembly (from global_asm!())
Ty(P<Ty>, Generics)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A type alias (type or pub type).
E.g. type Foo = Bar<u8>;
Existential(GenericBounds, Generics)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
An existential type declaration (existential type).
E.g. existential type Foo: Bar + Boo;
Enum(EnumDef, Generics)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
An enum definition (enum or pub enum).
E.g. enum Foo<A, B> { C<A>, D<B> }
Struct(VariantData, Generics)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A struct definition (struct or pub struct).
E.g. struct Foo<A> { x: A }
Union(VariantData, Generics)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A union definition (union or pub union).
E.g. union Foo<A, B> { x: A, y: B }
Trait(IsAuto, Unsafety, Generics, GenericBounds, Vec<TraitItem>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A Trait declaration (trait or pub trait).
E.g. trait Foo { .. }, trait Foo<T> { .. } or auto trait Foo {}
TraitAlias(Generics, GenericBounds)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Trait alias
E.g. trait Foo = Bar + Quux;
Impl(Unsafety, ImplPolarity, Defaultness, Generics, Option<TraitRef>, P<Ty>, Vec<ImplItem>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
An implementation.
E.g. impl<A> Foo<A> { .. } or impl<A> Trait for Foo<A> { .. }
Mac(Mac)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A macro invocation.
E.g. macro_rules! foo { .. } or foo!(..)
MacroDef(MacroDef)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A macro definition.
Methods
impl ItemKind[src]
impl ItemKindpub fn descriptive_variant(&self) -> &str[src]
pub fn descriptive_variant(&self) -> &str🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Trait Implementations
impl Clone for ItemKind[src]
impl Clone for ItemKindfn clone(&self) -> ItemKind[src]
fn clone(&self) -> ItemKindReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Encodable for ItemKind[src]
impl Encodable for ItemKindfn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>[src]
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl Decodable for ItemKind[src]
impl Decodable for ItemKindfn decode<__D: Decoder>(d: &mut __D) -> Result<ItemKind, __D::Error>[src]
fn decode<__D: Decoder>(d: &mut __D) -> Result<ItemKind, __D::Error>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
impl Debug for ItemKind[src]
impl Debug for ItemKind