Enum rustc_hir::hir::ItemKind[−][src]

pub enum ItemKind<'hir> {
Show variants ExternCrate(Option<Symbol>), Use(&'hir Path<'hir>, UseKind), Static(&'hir Ty<'hir>, Mutability, BodyId), Const(&'hir Ty<'hir>, BodyId), Fn(FnSig<'hir>, Generics<'hir>, BodyId), Mod(Mod<'hir>), ForeignMod { abi: Abi, items: &'hir [ForeignItemRef<'hir>], }, GlobalAsm(&'hir GlobalAsm), TyAlias(&'hir Ty<'hir>, Generics<'hir>), OpaqueTy(OpaqueTy<'hir>), Enum(EnumDef<'hir>, Generics<'hir>), Struct(VariantData<'hir>, Generics<'hir>), Union(VariantData<'hir>, Generics<'hir>), Trait(IsAuto, Unsafety, Generics<'hir>, GenericBounds<'hir>, &'hir [TraitItemRef]), TraitAlias(Generics<'hir>, GenericBounds<'hir>), Impl(Impl<'hir>),
}

Variants

ExternCrate(Option<Symbol>)
Expand description

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(&'hir Path<'hir>, UseKind)
Expand description

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)
Expand description

A static item.

Const(&'hir Ty<'hir>, BodyId)
Expand description

A const item.

Fn(FnSig<'hir>, Generics<'hir>, BodyId)
Expand description

A function declaration.

Mod(Mod<'hir>)
Expand description

A module.

ForeignMod
Expand description

An external module, e.g. extern { .. }.

Show fields

Fields of ForeignMod

abi: Abiitems: &'hir [ForeignItemRef<'hir>]
GlobalAsm(&'hir GlobalAsm)
Expand description

Module-level inline assembly (from global_asm!).

TyAlias(&'hir Ty<'hir>, Generics<'hir>)
Expand description

A type alias, e.g., type Foo = Bar<u8>.

OpaqueTy(OpaqueTy<'hir>)
Expand description

An opaque impl Trait type alias, e.g., type Foo = impl Bar;.

Enum(EnumDef<'hir>, Generics<'hir>)
Expand description

An enum definition, e.g., enum Foo<A, B> {C<A>, D<B>}.

Struct(VariantData<'hir>, Generics<'hir>)
Expand description

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

Union(VariantData<'hir>, Generics<'hir>)
Expand description

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

Trait(IsAuto, Unsafety, Generics<'hir>, GenericBounds<'hir>, &'hir [TraitItemRef])
Expand description

A trait definition.

TraitAlias(Generics<'hir>, GenericBounds<'hir>)
Expand description

A trait alias.

Impl(Impl<'hir>)
Expand description

An implementation, e.g., impl<A> Trait for Foo { .. }.

Implementations

impl ItemKind<'_>[src]

pub fn generics(&self) -> Option<&Generics<'_>>[src]

Trait Implementations

impl<'hir> Debug for ItemKind<'hir>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'hir, __CTX> HashStable<__CTX> for ItemKind<'hir> where
    __CTX: HashStableContext, 
[src]

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

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]

Performs the conversion.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.