pub enum ItemKind {
Show 21 variants
ExternCrate(Option<Symbol>, Ident),
Use(UseTree),
Static(Box<StaticItem>),
Const(Box<ConstItem>),
ConstBlock(ConstBlockItem),
Fn(Box<Fn>),
Mod(Safety, Ident, ModKind),
ForeignMod(ForeignMod),
GlobalAsm(Box<InlineAsm>),
TyAlias(Box<TyAlias>),
Enum(Ident, Generics, EnumDef),
Struct(Ident, Generics, VariantData),
Union(Ident, Generics, VariantData),
Trait(Box<Trait>),
TraitAlias(Box<TraitAlias>),
Impl(Impl),
MacCall(Box<MacCall>),
MacroDef(Ident, MacroDef),
Delegation(Box<Delegation>),
DelegationMac(Box<DelegationMac>),
TestBinderConstraints(Box<TestBinderConstraints>),
}Variants§
ExternCrate(Option<Symbol>, Ident)
An extern crate item, with the optional original crate name if the crate was renamed.
E.g., extern crate foo or extern crate foo_bar as foo.
Use(UseTree)
A use declaration item (use).
E.g., use foo;, use foo::bar; or use foo::bar as FooBar;.
Static(Box<StaticItem>)
A static item (static).
E.g., static FOO: i32 = 42; or static FOO: &'static str = "bar";.
Const(Box<ConstItem>)
A constant item (const).
E.g., const FOO: i32 = 42;.
ConstBlock(ConstBlockItem)
A module-level const block.
Equivalent to const _: () = const { ... };.
E.g., const { assert!(true) }.
Fn(Box<Fn>)
A function declaration (fn).
E.g., fn foo(bar: usize) -> usize { .. }.
Mod(Safety, Ident, ModKind)
A module declaration (mod).
E.g., mod foo; or mod foo { .. }.
unsafe keyword on modules is accepted syntactically for macro DSLs, but not
semantically by Rust.
ForeignMod(ForeignMod)
An external module (extern).
E.g., extern {} or extern "C" {}.
GlobalAsm(Box<InlineAsm>)
Module-level inline assembly (from global_asm!()).
TyAlias(Box<TyAlias>)
A type alias (type).
E.g., type Foo = Bar<u8>;.
Enum(Ident, Generics, EnumDef)
An enum definition (enum).
E.g., enum Foo<A, B> { C<A>, D<B> }.
Struct(Ident, Generics, VariantData)
A struct definition (struct).
E.g., struct Foo<A> { x: A }.
Union(Ident, Generics, VariantData)
A union definition (union).
E.g., union Foo<A, B> { x: A, y: B }.
Trait(Box<Trait>)
A trait declaration (trait).
E.g., trait Foo { .. }, trait Foo<T> { .. } or auto trait Foo {}.
TraitAlias(Box<TraitAlias>)
Trait alias.
E.g., trait Foo = Bar + Quux;.
Impl(Impl)
An implementation.
E.g., impl<A> Foo<A> { .. } or impl<A> Trait for Foo<A> { .. }.
MacCall(Box<MacCall>)
A macro invocation.
E.g., foo!(..).
MacroDef(Ident, MacroDef)
A macro definition.
Delegation(Box<Delegation>)
A single delegation item (reuse).
E.g. reuse <Type as Trait>::name { target_expr_template }.
DelegationMac(Box<DelegationMac>)
A list or glob delegation item (reuse prefix::{a, b, c}, reuse prefix::*).
Treated similarly to a macro call and expanded early.
TestBinderConstraints(Box<TestBinderConstraints>)
A test_binder_constraints!(). Perma-unstable, used only for rustc tests.
Implementations§
Trait Implementations§
Source§impl<__D: SpanDecoder> Decodable<__D> for ItemKind
impl<__D: SpanDecoder> Decodable<__D> for ItemKind
Source§impl<__E: SpanEncoder> Encodable<__E> for ItemKind
impl<__E: SpanEncoder> Encodable<__E> for ItemKind
Source§impl From<AssocItemKind> for ItemKind
impl From<AssocItemKind> for ItemKind
Source§fn from(assoc_item_kind: AssocItemKind) -> ItemKind
fn from(assoc_item_kind: AssocItemKind) -> ItemKind
Source§impl From<ForeignItemKind> for ItemKind
impl From<ForeignItemKind> for ItemKind
Source§fn from(foreign_item_kind: ForeignItemKind) -> ItemKind
fn from(foreign_item_kind: ForeignItemKind) -> ItemKind
Source§impl TryFrom<ItemKind> for AssocItemKind
impl TryFrom<ItemKind> for AssocItemKind
Source§impl TryFrom<ItemKind> for ForeignItemKind
impl TryFrom<ItemKind> for ForeignItemKind
Source§impl WalkItemKind for ItemKind
impl WalkItemKind for ItemKind
Auto Trait Implementations§
impl DynSend for ItemKindwhere
ThinVec<PathSegment>: DynSend,
ThinVec<UseTreeAndId>: DynSend,
Box<StaticItem>: DynSend,
Box<ConstItem>: DynSend,
Box<Block>: DynSend,
Box<Fn>: DynSend,
ThinVec<Box<Item>>: DynSend,
ThinVec<Box<Item<ForeignItemKind>>>: DynSend,
Box<InlineAsm>: DynSend,
Box<TyAlias>: DynSend,
ThinVec<GenericParam>: DynSend,
ThinVec<WherePredicate>: DynSend,
ThinVec<Variant>: DynSend,
ThinVec<FieldDef>: DynSend,
Box<Trait>: DynSend,
Box<TraitAlias>: DynSend,
Box<TraitImplHeader>: DynSend,
Box<Ty>: DynSend,
ThinVec<Box<Item<AssocItemKind>>>: DynSend,
Box<MacCall>: DynSend,
Box<DelimArgs>: DynSend,
Box<Delegation>: DynSend,
Box<DelegationMac>: DynSend,
Box<TestBinderConstraints>: DynSend,
impl DynSync for ItemKindwhere
ThinVec<PathSegment>: DynSync,
ThinVec<UseTreeAndId>: DynSync,
Box<StaticItem>: DynSync,
Box<ConstItem>: DynSync,
Box<Block>: DynSync,
Box<Fn>: DynSync,
ThinVec<Box<Item>>: DynSync,
ThinVec<Box<Item<ForeignItemKind>>>: DynSync,
Box<InlineAsm>: DynSync,
Box<TyAlias>: DynSync,
ThinVec<GenericParam>: DynSync,
ThinVec<WherePredicate>: DynSync,
ThinVec<Variant>: DynSync,
ThinVec<FieldDef>: DynSync,
Box<Trait>: DynSync,
Box<TraitAlias>: DynSync,
Box<TraitImplHeader>: DynSync,
Box<Ty>: DynSync,
ThinVec<Box<Item<AssocItemKind>>>: DynSync,
Box<MacCall>: DynSync,
Box<DelimArgs>: DynSync,
Box<Delegation>: DynSync,
Box<DelegationMac>: DynSync,
Box<TestBinderConstraints>: DynSync,
impl Forget for ItemKind
impl Freeze for ItemKindwhere
*const Header is !null: Freeze,
PhantomData<PathSegment>: Freeze,
PhantomData<UseTreeAndId>: Freeze,
*const StaticItem is !null: Freeze,
PhantomData<StaticItem>: Freeze,
*const ConstItem is !null: Freeze,
PhantomData<ConstItem>: Freeze,
*const Block is !null: Freeze,
PhantomData<Block>: Freeze,
*const Fn is !null: Freeze,
PhantomData<Fn>: Freeze,
PhantomData<Box<Item>>: Freeze,
PhantomData<Box<Item<ForeignItemKind>>>: Freeze,
*const InlineAsm is !null: Freeze,
PhantomData<InlineAsm>: Freeze,
*const TyAlias is !null: Freeze,
PhantomData<TyAlias>: Freeze,
PhantomData<GenericParam>: Freeze,
PhantomData<WherePredicate>: Freeze,
PhantomData<Variant>: Freeze,
PhantomData<FieldDef>: Freeze,
*const Trait is !null: Freeze,
PhantomData<Trait>: Freeze,
*const TraitAlias is !null: Freeze,
PhantomData<TraitAlias>: Freeze,
*const TraitImplHeader is !null: Freeze,
PhantomData<TraitImplHeader>: Freeze,
*const Ty is !null: Freeze,
PhantomData<Ty>: Freeze,
PhantomData<Box<Item<AssocItemKind>>>: Freeze,
*const MacCall is !null: Freeze,
PhantomData<MacCall>: Freeze,
*const DelimArgs is !null: Freeze,
PhantomData<DelimArgs>: Freeze,
*const Delegation is !null: Freeze,
PhantomData<Delegation>: Freeze,
*const DelegationMac is !null: Freeze,
PhantomData<DelegationMac>: Freeze,
*const TestBinderConstraints is !null: Freeze,
PhantomData<TestBinderConstraints>: Freeze,
impl Move for ItemKind
impl RefUnwindSafe for ItemKind
impl Send for ItemKindwhere
ThinVec<PathSegment>: Send,
ThinVec<UseTreeAndId>: Send,
BoxRaw<StaticItem>: Send,
BoxRaw<ConstItem>: Send,
BoxRaw<Block>: Send,
BoxRaw<Fn>: Send,
ThinVec<Box<Item>>: Send,
ThinVec<Box<Item<ForeignItemKind>>>: Send,
BoxRaw<InlineAsm>: Send,
BoxRaw<TyAlias>: Send,
ThinVec<GenericParam>: Send,
ThinVec<WherePredicate>: Send,
ThinVec<Variant>: Send,
ThinVec<FieldDef>: Send,
BoxRaw<Trait>: Send,
BoxRaw<TraitAlias>: Send,
BoxRaw<TraitImplHeader>: Send,
BoxRaw<Ty>: Send,
ThinVec<Box<Item<AssocItemKind>>>: Send,
BoxRaw<MacCall>: Send,
BoxRaw<DelimArgs>: Send,
BoxRaw<Delegation>: Send,
BoxRaw<DelegationMac>: Send,
BoxRaw<TestBinderConstraints>: Send,
impl Sync for ItemKindwhere
ThinVec<PathSegment>: Sync,
ThinVec<UseTreeAndId>: Sync,
BoxRaw<StaticItem>: Sync,
BoxRaw<ConstItem>: Sync,
BoxRaw<Block>: Sync,
BoxRaw<Fn>: Sync,
ThinVec<Box<Item>>: Sync,
ThinVec<Box<Item<ForeignItemKind>>>: Sync,
BoxRaw<InlineAsm>: Sync,
BoxRaw<TyAlias>: Sync,
ThinVec<GenericParam>: Sync,
ThinVec<WherePredicate>: Sync,
ThinVec<Variant>: Sync,
ThinVec<FieldDef>: Sync,
BoxRaw<Trait>: Sync,
BoxRaw<TraitAlias>: Sync,
BoxRaw<TraitImplHeader>: Sync,
BoxRaw<Ty>: Sync,
ThinVec<Box<Item<AssocItemKind>>>: Sync,
BoxRaw<MacCall>: Sync,
BoxRaw<DelimArgs>: Sync,
BoxRaw<Delegation>: Sync,
BoxRaw<DelegationMac>: Sync,
BoxRaw<TestBinderConstraints>: Sync,
impl Unpin for ItemKindwhere
*const Header is !null: Unpin,
Box<GenericArgs>: Unpin,
Box<StaticItem>: Unpin,
Box<ConstItem>: Unpin,
Box<Block>: Unpin,
Box<Fn>: Unpin,
Box<Item>: Unpin,
Box<Item<ForeignItemKind>>: Unpin,
Box<InlineAsm>: Unpin,
Box<TyAlias>: Unpin,
Box<NormalAttr>: Unpin,
Box<SyntheticAttr>: Unpin,
Box<Ty>: Unpin,
Box<Expr>: Unpin,
Box<Path>: Unpin,
Box<FieldDefExtras>: Unpin,
Box<Trait>: Unpin,
Box<TraitAlias>: Unpin,
Box<TraitImplHeader>: Unpin,
Box<Item<AssocItemKind>>: Unpin,
Box<MacCall>: Unpin,
Box<DelimArgs>: Unpin,
Box<Delegation>: Unpin,
Box<DelegationMac>: Unpin,
Box<TestBinderConstraints>: Unpin,
impl UnsafeUnpin for ItemKindwhere
*const Header is !null: UnsafeUnpin,
PhantomData<PathSegment>: UnsafeUnpin,
PhantomData<UseTreeAndId>: UnsafeUnpin,
*const StaticItem is !null: UnsafeUnpin,
PhantomData<StaticItem>: UnsafeUnpin,
*const ConstItem is !null: UnsafeUnpin,
PhantomData<ConstItem>: UnsafeUnpin,
*const Block is !null: UnsafeUnpin,
PhantomData<Block>: UnsafeUnpin,
*const Fn is !null: UnsafeUnpin,
PhantomData<Fn>: UnsafeUnpin,
PhantomData<Box<Item>>: UnsafeUnpin,
PhantomData<Box<Item<ForeignItemKind>>>: UnsafeUnpin,
*const InlineAsm is !null: UnsafeUnpin,
PhantomData<InlineAsm>: UnsafeUnpin,
*const TyAlias is !null: UnsafeUnpin,
PhantomData<TyAlias>: UnsafeUnpin,
PhantomData<GenericParam>: UnsafeUnpin,
PhantomData<WherePredicate>: UnsafeUnpin,
PhantomData<Variant>: UnsafeUnpin,
PhantomData<FieldDef>: UnsafeUnpin,
*const Trait is !null: UnsafeUnpin,
PhantomData<Trait>: UnsafeUnpin,
*const TraitAlias is !null: UnsafeUnpin,
PhantomData<TraitAlias>: UnsafeUnpin,
*const TraitImplHeader is !null: UnsafeUnpin,
PhantomData<TraitImplHeader>: UnsafeUnpin,
*const Ty is !null: UnsafeUnpin,
PhantomData<Ty>: UnsafeUnpin,
PhantomData<Box<Item<AssocItemKind>>>: UnsafeUnpin,
*const MacCall is !null: UnsafeUnpin,
PhantomData<MacCall>: UnsafeUnpin,
*const DelimArgs is !null: UnsafeUnpin,
PhantomData<DelimArgs>: UnsafeUnpin,
*const Delegation is !null: UnsafeUnpin,
PhantomData<Delegation>: UnsafeUnpin,
*const DelegationMac is !null: UnsafeUnpin,
PhantomData<DelegationMac>: UnsafeUnpin,
*const TestBinderConstraints is !null: UnsafeUnpin,
PhantomData<TestBinderConstraints>: UnsafeUnpin,
impl UnwindSafe for ItemKindwhere
NonNull<Header>: UnwindSafe,
BoxRaw<GenericArgs>: UnwindSafe,
BoxRaw<StaticItem>: UnwindSafe,
BoxRaw<ConstItem>: UnwindSafe,
BoxRaw<Block>: UnwindSafe,
BoxRaw<Fn>: UnwindSafe,
BoxRaw<Item>: UnwindSafe,
BoxRaw<Item<ForeignItemKind>>: UnwindSafe,
BoxRaw<InlineAsm>: UnwindSafe,
BoxRaw<TyAlias>: UnwindSafe,
BoxRaw<NormalAttr>: UnwindSafe,
BoxRaw<SyntheticAttr>: UnwindSafe,
BoxRaw<Ty>: UnwindSafe,
BoxRaw<Expr>: UnwindSafe,
BoxRaw<Path>: UnwindSafe,
BoxRaw<FieldDefExtras>: UnwindSafe,
BoxRaw<Trait>: UnwindSafe,
BoxRaw<TraitAlias>: UnwindSafe,
BoxRaw<TraitImplHeader>: UnwindSafe,
BoxRaw<Item<AssocItemKind>>: UnwindSafe,
BoxRaw<MacCall>: UnwindSafe,
BoxRaw<DelimArgs>: UnwindSafe,
BoxRaw<Delegation>: UnwindSafe,
BoxRaw<DelegationMac>: UnwindSafe,
BoxRaw<TestBinderConstraints>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 88 bytes
Size for each variant:
ExternCrate: 16 bytesUse: 44 bytesStatic: 12 bytesConst: 12 bytesConstBlock: 28 bytesFn: 12 bytesMod: 60 bytesForeignMod: 60 bytesGlobalAsm: 12 bytesTyAlias: 12 bytesEnum: 60 bytesStruct: 68 bytesUnion: 68 bytesTrait: 12 bytesTraitAlias: 12 bytesImpl: 84 bytesMacCall: 12 bytesMacroDef: 52 bytesDelegation: 12 bytesDelegationMac: 12 bytesTestBinderConstraints: 12 bytes