Struct rustdoc::clean::types::Item [−][src]
pub(crate) struct Item {
pub(crate) name: Option<Symbol>,
pub(crate) attrs: Box<Attributes>,
pub(crate) visibility: Visibility,
pub(crate) kind: Box<ItemKind>,
pub(crate) def_id: FakeDefId,
pub(crate) cfg: Option<Arc<Cfg>>,
}Expand description
Anything with a source location and set of attributes and, optionally, a name. That is, anything that can be documented. This doesn’t correspond directly to the AST’s concept of an item; it’s a strict superset.
Fields
name: Option<Symbol>The name of this item. Optional because not every item has a name, e.g. impls.
attrs: Box<Attributes>visibility: Visibilitykind: Box<ItemKind>Information about this item that is specific to what kind of item it is. E.g., struct vs enum vs function.
def_id: FakeDefIdcfg: Option<Arc<Cfg>>Implementations
Finds the doc attribute as a NameValue and returns the corresponding
value found.
pub fn from_hir_id_and_parts(
hir_id: HirId,
name: Option<Symbol>,
kind: ItemKind,
cx: &mut DocContext<'_>
) -> Item[src]
pub fn from_hir_id_and_parts(
hir_id: HirId,
name: Option<Symbol>,
kind: ItemKind,
cx: &mut DocContext<'_>
) -> Item[src]Convenience wrapper around Self::from_def_id_and_parts which converts
hir_id to a DefId
pub fn from_def_id_and_parts(
def_id: DefId,
name: Option<Symbol>,
kind: ItemKind,
cx: &mut DocContext<'_>
) -> Item[src]pub fn from_def_id_and_attrs_and_parts(
def_id: DefId,
name: Option<Symbol>,
kind: ItemKind,
attrs: Box<Attributes>,
cx: &mut DocContext<'_>,
cfg: Option<Arc<Cfg>>
) -> Item[src]Finds all doc attributes as NameValues and returns their corresponding values, joined
with newlines.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Itemimpl !UnwindSafe for ItemBlanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
pub fn vzip(self) -> VLayout
Note: Most layout information is completely unstable and may be different between compiler versions and platforms. 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