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>, Unsafety, Spanned<Constness>, Abi, Generics, P<Block>),
Mod(Mod),
ForeignMod(ForeignMod),
GlobalAsm(P<GlobalAsm>),
Ty(P<Ty>, Generics),
Enum(EnumDef, Generics),
Struct(VariantData, Generics),
Union(VariantData, Generics),
Trait(IsAuto, Unsafety, Generics, TyParamBounds, Vec<TraitItem>),
TraitAlias(Generics, TyParamBounds),
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>, Unsafety, Spanned<Constness>, Abi, 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>;
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, TyParamBounds, 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, TyParamBounds)🔬 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 PartialEq for ItemKind[src]
impl PartialEq for ItemKindfn eq(&self, other: &ItemKind) -> bool[src]
fn eq(&self, other: &ItemKind) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &ItemKind) -> bool[src]
fn ne(&self, other: &ItemKind) -> boolThis method tests for !=.
impl Eq for ItemKind[src]
impl Eq for ItemKindfn assert_receiver_is_total_eq(&self)[src]
fn assert_receiver_is_total_eq(&self)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 Hash for ItemKind[src]
impl Hash for ItemKindfn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Debug for ItemKind[src]
impl Debug for ItemKind