pub(crate) enum ItemKind {
Show 28 variants
ExternCrate {
src: Option<Symbol>,
},
Import(Import),
Struct(Struct),
Union(Union),
Enum(Enum),
Function(Box<Function>),
Module(Module),
TypeAlias(Box<TypeAlias>),
Static(Static),
Trait(Box<Trait>),
TraitAlias(TraitAlias),
Impl(Box<Impl>),
PlaceholderImpl,
AssocFunction(Box<AssocFunction>),
StructField(Type),
Variant(Variant),
ForeignFunction(Box<Function>, Safety),
ForeignStatic(Static, Safety),
ForeignType,
DeclMacro(DeclMacro, MacroKinds),
ProcMacro(ProcMacro),
PrimitiveType(PrimitiveType),
Constant(Box<Constant>),
AssocConstant(Box<AssocConstant>),
AssocType(Box<AssocType>),
Stripped(Box<ItemKind>),
Keyword,
Attribute,
}Variants§
ExternCrate
Import(Import)
Struct(Struct)
Union(Union)
Enum(Enum)
Function(Box<Function>)
Module(Module)
TypeAlias(Box<TypeAlias>)
Static(Static)
Trait(Box<Trait>)
TraitAlias(TraitAlias)
Impl(Box<Impl>)
PlaceholderImpl
This variant is used only as a placeholder for trait impls in order to correctly compute
doc_cfg as trait impls are added to clean::Crate after we went through the whole tree.
AssocFunction(Box<AssocFunction>)
StructField(Type)
Variant(Variant)
ForeignFunction(Box<Function>, Safety)
fns from an extern block
ForeignStatic(Static, Safety)
statics from an extern block
ForeignType
types from an extern block
DeclMacro(DeclMacro, MacroKinds)
A macro defined with macro_rules or the macro keyword. It can be multiple things (macro,
derive and attribute, potentially multiple at once). Don’t forget to look into the
MacroKinds values.
If a macro_rules! only contains a attr/derive branch, then it’s not stored in this
variant but in the ProcMacroItem variant.
ProcMacro(ProcMacro)
PrimitiveType(PrimitiveType)
Constant(Box<Constant>)
AssocConstant(Box<AssocConstant>)
AssocType(Box<AssocType>)
Stripped(Box<ItemKind>)
An item that has been stripped by a rustdoc pass
Keyword
This item represents an anonymous constant with a #[doc(keyword = "...")] attribute which is used
to generate documentation for Rust keywords.
Attribute
This item represents an anonymous constant with a #[doc(attribute = "...")] attribute which is used
to generate documentation for Rust builtin attributes.
Implementations§
Source§impl ItemKind
impl ItemKind
Sourcepub(crate) fn inner_items(&self) -> impl Iterator<Item = &Item>
pub(crate) fn inner_items(&self) -> impl Iterator<Item = &Item>
Some items contain others such as structs (for their fields) and Enums (for their variants). This method returns those contained items.
pub(crate) fn unstripped(&self) -> &Self
Trait Implementations§
Auto Trait Implementations§
impl DynSend for ItemKind
impl DynSync for ItemKind
impl Forget for ItemKind
impl Freeze for ItemKind
impl RefUnwindSafe for ItemKind
impl Send for ItemKind
impl Sync for ItemKind
impl Unpin for ItemKind
impl UnsafeUnpin for ItemKind
impl UnwindSafe for ItemKind
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§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: 48 bytes
Size for each variant:
ExternCrate: 7 bytesImport: 47 bytesStruct: 39 bytesUnion: 47 bytesEnum: 47 bytesFunction: 15 bytesModule: 39 bytesTypeAlias: 15 bytesStatic: 31 bytesTrait: 15 bytesTraitAlias: 47 bytesImpl: 15 bytesPlaceholderImpl: 0 bytesAssocFunction: 15 bytesStructField: 39 bytesVariant: 39 bytesForeignFunction: 15 bytesForeignStatic: 31 bytesForeignType: 0 bytesDeclMacro: 39 bytesProcMacro: 39 bytesPrimitiveType: 1 byteConstant: 15 bytesAssocConstant: 15 bytesAssocType: 15 bytesStripped: 15 bytesKeyword: 0 bytesAttribute: 0 bytes