[−][src]Struct rustdoc::clean::types::Item

pub(crate) struct Item {
    pub(crate) source: Span,
    pub(crate) name: Option<String>,
    pub(crate) attrs: Attributes,
    pub(crate) visibility: Visibility,
    pub(crate) kind: ItemKind,
    pub(crate) def_id: DefId,
    pub(crate) stability: Option<Stability>,
    pub(crate) deprecation: Option<Deprecation>,
}

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

source: Span

Stringified span

name: Option<String>

Not everything has a name. E.g., impls

attrs: Attributesvisibility: Visibilitykind: ItemKinddef_id: DefIdstability: Option<Stability>deprecation: Option<Deprecation>

Implementations

impl Item[src]

pub(crate) fn doc_value(&self) -> Option<&str>[src]

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: &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: &DocContext<'_>
) -> Item
[src]

pub(crate) fn collapsed_doc_value(&self) -> Option<String>[src]

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

pub(crate) fn is_crate(&self) -> bool[src]

pub(crate) fn is_mod(&self) -> bool[src]

pub(crate) fn is_trait(&self) -> bool[src]

pub(crate) fn is_struct(&self) -> bool[src]

pub(crate) fn is_enum(&self) -> bool[src]

pub(crate) fn is_variant(&self) -> bool[src]

pub(crate) fn is_associated_type(&self) -> bool[src]

pub(crate) fn is_associated_const(&self) -> bool[src]

pub(crate) fn is_method(&self) -> bool[src]

pub(crate) fn is_ty_method(&self) -> bool[src]

pub(crate) fn is_typedef(&self) -> bool[src]

pub(crate) fn is_primitive(&self) -> bool[src]

pub(crate) fn is_union(&self) -> bool[src]

pub(crate) fn is_import(&self) -> bool[src]

pub(crate) fn is_extern_crate(&self) -> bool[src]

pub(crate) fn is_keyword(&self) -> bool[src]

pub(crate) fn is_stripped(&self) -> bool[src]

pub(crate) fn has_stripped_fields(&self) -> Option<bool>[src]

pub(crate) fn stability_class(&self) -> Option<String>[src]

pub(crate) fn stable_since(&self) -> Option<SymbolStr>[src]

pub(crate) fn is_non_exhaustive(&self) -> bool[src]

pub(crate) fn type_(&self) -> ItemType[src]

Returns a documentation-level item type from the item.

pub(crate) fn is_default(&self) -> bool[src]

pub(crate) fn is_fake(&self) -> bool[src]

See comments on next_def_id

Trait Implementations

impl<'_> Clean<Item> for Module<'_>[src]

impl<'_> Clean<Item> for Function<'_>[src]

impl<'_> Clean<Item> for Union<'_>[src]

impl<'_> Clean<Item> for Enum<'_>[src]

impl<'_> Clean<Item> for Variant<'_>[src]

impl Clean<Item> for VariantDef[src]

impl<'_> Clean<Item> for Typedef<'_>[src]

impl<'_> Clean<Item> for OpaqueTy<'_>[src]

impl<'_> Clean<Item> for Static<'_>[src]

impl<'_> Clean<Item> for Constant<'_>[src]

impl<'_> Clean<Item> for ForeignItem<'_>[src]

impl Clean<Item> for Macro[src]

impl<'_> Clean<Item> for Trait<'_>[src]

impl Clean<Item> for ProcMacro[src]

impl<'_> Clean<Item> for TraitAlias<'_>[src]

impl<'_> Clean<Item> for TraitItem<'_>[src]

impl<'_> Clean<Item> for ImplItem<'_>[src]

impl Clean<Item> for AssocItem[src]

impl<'_> Clean<Item> for StructField<'_>[src]

impl Clean<Item> for FieldDef[src]

impl<'_> Clean<Item> for Struct<'_>[src]

impl Clone for Item[src]

impl Debug for Item[src]

impl<'a> From<&'a Item> for ItemType[src]

Auto Trait Implementations

impl !RefUnwindSafe for Item

impl !Send for Item

impl !Sync for Item

impl Unpin for Item

impl !UnwindSafe for Item

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

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

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

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

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

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithConstness for T[src]