[−][src]Enum rustc_hir::hir::ItemKind
Variants
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 foo::bar::*; or use foo::bar::baz as quux;
or just
use foo::bar::baz; (with as baz implicitly on the right).
Static(&'hir Ty<'hir>, Mutability, BodyId)A static item.
A const item.
A function declaration.
Mod(Mod<'hir>)A module.
ForeignMod(ForeignMod<'hir>)An external module, e.g. extern { .. }.
GlobalAsm(&'hir GlobalAsm)Module-level inline assembly (from global_asm!).
A type alias, e.g., type Foo = Bar<u8>.
OpaqueTy(OpaqueTy<'hir>)An opaque impl Trait type alias, e.g., type Foo = impl Bar;.
An enum definition, e.g., enum Foo<A, B> {C<A>, D<B>}.
Struct(VariantData<'hir>, Generics<'hir>)A struct definition, e.g., struct Foo<A> {x: A}.
Union(VariantData<'hir>, Generics<'hir>)A union definition, e.g., union Foo<A, B> {x: A, y: B}.
Trait(IsAuto, Unsafety, Generics<'hir>, GenericBounds<'hir>, &'hir [TraitItemRef])A trait definition.
TraitAlias(Generics<'hir>, GenericBounds<'hir>)A trait alias.
An implementation, e.g., impl<A> Trait for Foo { .. }.
Fields of Impl
unsafety: Unsafetypolarity: ImplPolaritydefaultness: Defaultnessdefaultness_span: Option<Span>constness: Constnessgenerics: Generics<'hir>of_trait: Option<TraitRef<'hir>>The trait being implemented, if any.
self_ty: &'hir Ty<'hir>items: &'hir [ImplItemRef<'hir>]Implementations
impl<'_> ItemKind<'_>[src]
Trait Implementations
impl<'hir> Debug for ItemKind<'hir>[src]
impl<'hir, __CTX> HashStable<__CTX> for ItemKind<'hir> where
__CTX: HashStableContext, [src]
__CTX: HashStableContext,
pub fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)[src]
Auto Trait Implementations
impl<'hir> !RefUnwindSafe for ItemKind<'hir>
impl<'hir> !Send for ItemKind<'hir>
impl<'hir> !Sync for ItemKind<'hir>
impl<'hir> Unpin for ItemKind<'hir>
impl<'hir> !UnwindSafe for ItemKind<'hir>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,