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: ItemId,
    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: ItemIdcfg: Option<Arc<Cfg>>

Implementations

Finds the doc attribute as a NameValue and returns the corresponding value found.

Convenience wrapper around Self::from_def_id_and_parts which converts hir_id to a DefId

Finds all doc attributes as NameValues and returns their corresponding values, joined with newlines.

Find a list of all link names, without finding their href.

This is used for generating summary text, which does not include the link text, but does need to know which []-bracketed names are actually links.

Returns a documentation-level item type from the item.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

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: 56 bytes