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

pub(crate) struct Item {
    pub(crate) span: Span,
    pub(crate) name: Option<Symbol>,
    pub(crate) attrs: Box<Attributes>,
    pub(crate) visibility: Visibility,
    pub(crate) kind: Box<ItemKind>,
    pub(crate) def_id: DefId,

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.


span: Spanname: 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: DefId


impl Item[src]

pub(crate) fn stability<'tcx>(
    tcx: TyCtxt<'tcx>
) -> Option<&'tcx Stability>

pub(crate) fn const_stability<'tcx>(
    tcx: TyCtxt<'tcx>
) -> Option<&'tcx ConstStability>

pub(crate) fn deprecation(&self, tcx: TyCtxt<'_>) -> Option<Deprecation>[src]

pub(crate) fn doc_value(&self) -> Option<String>[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: &mut DocContext<'_>
) -> Item

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

pub fn from_def_id_and_attrs_and_parts(
    def_id: DefId,
    name: Option<Symbol>,
    kind: ItemKind,
    attrs: Box<Attributes>,
    cx: &mut DocContext<'_>
) -> Item

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, tcx: TyCtxt<'_>) -> Option<String>[src]

pub(crate) fn stable_since(&self, tcx: TyCtxt<'_>) -> Option<SymbolStr>[src]

pub(crate) fn const_stable_since(&self, tcx: TyCtxt<'_>) -> 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 the documentation for next_def_id().

Trait Implementations

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

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

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

impl Clean<Item> for AssocItem[src]

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

impl Clean<Item> for FieldDef[src]

impl Clean<Item> for VariantDef[src]

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

impl Clean<Item> for (&ForeignItem<'_>, Option<Symbol>)[src]

impl Clean<Item> for (&MacroDef<'_>, Option<Symbol>)[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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<'a, T> Captures<'a> for T where
    T: ?Sized

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

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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]