Enum rustc::hir::Item_ [−][src]
pub enum Item_ {
ItemExternCrate(Option<Name>),
ItemUse(P<Path>, UseKind),
ItemStatic(P<Ty>, Mutability, BodyId),
ItemConst(P<Ty>, BodyId),
ItemFn(P<FnDecl>, Unsafety, Constness, Abi, Generics, BodyId),
ItemMod(Mod),
ItemForeignMod(ForeignMod),
ItemGlobalAsm(P<GlobalAsm>),
ItemTy(P<Ty>, Generics),
ItemExistential(ExistTy),
ItemEnum(EnumDef, Generics),
ItemStruct(VariantData, Generics),
ItemUnion(VariantData, Generics),
ItemTrait(IsAuto, Unsafety, Generics, TyParamBounds, HirVec<TraitItemRef>),
ItemTraitAlias(Generics, TyParamBounds),
ItemImpl(Unsafety, ImplPolarity, Defaultness, Generics, Option<TraitRef>, P<Ty>, HirVec<ImplItemRef>),
}🔬 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
ItemExternCrate(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
ItemUse(P<Path>, UseKind)🔬 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?
use foo::bar::*; or use foo::bar::baz as quux;
or just
use foo::bar::baz; (with as baz implicitly on the right)
ItemStatic(P<Ty>, Mutability, BodyId)🔬 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
ItemConst(P<Ty>, BodyId)🔬 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 const item
ItemFn(P<FnDecl>, Unsafety, Constness, Abi, Generics, BodyId)🔬 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
ItemMod(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
ItemForeignMod(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
ItemGlobalAsm(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!)
ItemTy(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, e.g. type Foo = Bar<u8>
ItemExistential(ExistTy)🔬 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, e.g. type Foo = Bar<u8>
ItemEnum(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, e.g. enum Foo<A, B> {C<A>, D<B>}
ItemStruct(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, e.g. struct Foo<A> {x: A}
ItemUnion(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, e.g. union Foo<A, B> {x: A, y: B}
ItemTrait(IsAuto, Unsafety, Generics, TyParamBounds, HirVec<TraitItemRef>)🔬 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?
Represents a Trait Declaration
ItemTraitAlias(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?
Represents a Trait Alias Declaration
ItemImpl(Unsafety, ImplPolarity, Defaultness, Generics, Option<TraitRef>, P<Ty>, HirVec<ImplItemRef>)🔬 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, eg impl<A> Trait for Foo { .. }
Methods
impl Item_[src]
impl Item_pub 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?
pub fn adt_kind(&self) -> Option<AdtKind>[src]
pub fn adt_kind(&self) -> Option<AdtKind>🔬 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?
pub fn generics(&self) -> Option<&Generics>[src]
pub fn generics(&self) -> Option<&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?
Trait Implementations
impl Clone for Item_[src]
impl Clone for Item_fn clone(&self) -> Item_[src]
fn clone(&self) -> Item_Returns 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 Item_[src]
impl PartialEq for Item_fn eq(&self, other: &Item_) -> bool[src]
fn eq(&self, other: &Item_) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Item_) -> bool[src]
fn ne(&self, other: &Item_) -> boolThis method tests for !=.
impl Eq for Item_[src]
impl Eq for Item_fn assert_receiver_is_total_eq(&self)[src]
fn assert_receiver_is_total_eq(&self)impl Encodable for Item_[src]
impl Encodable for Item_fn 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 Item_[src]
impl Decodable for Item_fn decode<__D: Decoder>(d: &mut __D) -> Result<Item_, __D::Error>[src]
fn decode<__D: Decoder>(d: &mut __D) -> Result<Item_, __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 Item_[src]
impl Hash for Item_fn 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 Item_[src]
impl Debug for Item_fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Item_[src]
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Item_fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
)[src]
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
)🔬 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?