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) item_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.
item_id: ItemIdcfg: Option<Arc<Cfg>>Implementations
sourceimpl Item
impl Item
pub(crate) fn stability<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Option<Stability>
pub(crate) fn const_stability<'tcx>(
&self,
tcx: TyCtxt<'tcx>
) -> Option<ConstStability>
pub(crate) fn deprecation(&self, tcx: TyCtxt<'_>) -> Option<Deprecation>
pub(crate) fn inner_docs(&self, tcx: TyCtxt<'_>) -> bool
pub(crate) fn span(&self, tcx: TyCtxt<'_>) -> Span
pub(crate) fn attr_span(&self, tcx: TyCtxt<'_>) -> Span
sourcepub(crate) fn doc_value(&self) -> Option<String>
pub(crate) fn doc_value(&self) -> Option<String>
Finds the doc attribute as a NameValue and returns the corresponding
value found.
sourcepub(crate) fn from_hir_id_and_parts(
hir_id: HirId,
name: Option<Symbol>,
kind: ItemKind,
cx: &mut DocContext<'_>
) -> Item
pub(crate) 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(crate) fn from_def_id_and_parts(
def_id: DefId,
name: Option<Symbol>,
kind: ItemKind,
cx: &mut DocContext<'_>
) -> Item
pub(crate) 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
sourcepub(crate) fn collapsed_doc_value(&self) -> Option<String>
pub(crate) fn collapsed_doc_value(&self) -> Option<String>
Finds all doc attributes as NameValues and returns their corresponding values, joined
with newlines.
pub(crate) fn links(&self, cx: &Context<'_>) -> Vec<RenderedLink>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourcepub(crate) fn link_names(&self, cache: &Cache) -> Vec<RenderedLink>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub(crate) fn link_names(&self, cache: &Cache) -> Vec<RenderedLink>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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.
pub(crate) fn is_crate(&self) -> bool
pub(crate) fn is_mod(&self) -> bool
pub(crate) fn is_trait(&self) -> bool
pub(crate) fn is_struct(&self) -> bool
pub(crate) fn is_enum(&self) -> bool
pub(crate) fn is_variant(&self) -> bool
pub(crate) fn is_associated_type(&self) -> bool
pub(crate) fn is_ty_associated_type(&self) -> bool
pub(crate) fn is_associated_const(&self) -> bool
pub(crate) fn is_ty_associated_const(&self) -> bool
pub(crate) fn is_method(&self) -> bool
pub(crate) fn is_ty_method(&self) -> bool
pub(crate) fn is_typedef(&self) -> bool
pub(crate) fn is_primitive(&self) -> bool
pub(crate) fn is_union(&self) -> bool
pub(crate) fn is_import(&self) -> bool
pub(crate) fn is_extern_crate(&self) -> bool
pub(crate) fn is_keyword(&self) -> bool
pub(crate) fn is_stripped(&self) -> bool
pub(crate) fn has_stripped_entries(&self) -> Option<bool>
pub(crate) fn stability_class(&self, tcx: TyCtxt<'_>) -> Option<String>
pub(crate) fn stable_since(&self, tcx: TyCtxt<'_>) -> Option<Symbol>
pub(crate) fn const_stable_since(&self, tcx: TyCtxt<'_>) -> Option<Symbol>
pub(crate) fn is_non_exhaustive(&self) -> bool
pub(crate) fn is_default(&self) -> bool
Trait Implementations
sourceimpl<'tcx> Clean<'tcx, Item> for AssocItem
impl<'tcx> Clean<'tcx, Item> for AssocItem
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item
sourceimpl<'tcx> Clean<'tcx, Item> for DocModule<'tcx>
impl<'tcx> Clean<'tcx, Item> for DocModule<'tcx>
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item
sourceimpl<'tcx> Clean<'tcx, Item> for ImplItem<'tcx>
impl<'tcx> Clean<'tcx, Item> for ImplItem<'tcx>
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item
sourceimpl<'tcx> Clean<'tcx, Item> for TraitItem<'tcx>
impl<'tcx> Clean<'tcx, Item> for TraitItem<'tcx>
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item
sourceimpl<'tcx> Clean<'tcx, Item> for Variant<'tcx>
impl<'tcx> Clean<'tcx, Item> for Variant<'tcx>
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item
sourceimpl<'tcx> Clean<'tcx, Item> for VariantDef
impl<'tcx> Clean<'tcx, Item> for VariantDef
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn 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>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
impl<'a, T> Captures<'a> for T where
T: ?Sized,
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