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>Expand description
The name of this item. Optional because not every item has a name, e.g. impls.
attrs: Box<Attributes>visibility: Visibilitykind: Box<ItemKind>Expand description
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
impl Item[src]
impl Item[src]pub(crate) fn stability<'tcx>(
&self,
tcx: TyCtxt<'tcx>
) -> Option<&'tcx Stability>[src]
&self,
tcx: TyCtxt<'tcx>
) -> Option<&'tcx Stability>
pub(crate) fn const_stability<'tcx>(
&self,
tcx: TyCtxt<'tcx>
) -> Option<&'tcx ConstStability>[src]
&self,
tcx: TyCtxt<'tcx>
) -> Option<&'tcx ConstStability>
pub(crate) fn deprecation(&self, tcx: TyCtxt<'_>) -> Option<Deprecation>[src]
pub(crate) fn inner_docs(&self, tcx: TyCtxt<'_>) -> bool[src]
pub(crate) fn span(&self, tcx: TyCtxt<'_>) -> Span[src]
pub(crate) fn attr_span(&self, tcx: TyCtxt<'_>) -> Span[src]
pub(crate) fn doc_value(&self) -> Option<String>[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[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]
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<'_>,
cfg: Option<Arc<Cfg>>
) -> Item[src]
def_id: DefId,
name: Option<Symbol>,
kind: ItemKind,
attrs: Box<Attributes>,
cx: &mut DocContext<'_>,
cfg: Option<Arc<Cfg>>
) -> Item
pub(crate) fn collapsed_doc_value(&self) -> Option<String>[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 links(&self, cx: &Context<'_>) -> Vec<RenderedLink>[src]
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 is_default(&self) -> bool[src]
pub(crate) fn is_fake(&self) -> bool[src]
Trait Implementations
impl Clean<Item> for VariantDef[src]
impl Clean<Item> for VariantDef[src]fn clean(&self, cx: &mut DocContext<'_>) -> Item[src]
impl Clean<Item> for (&ForeignItem<'_>, Option<Symbol>)[src]
impl Clean<Item> for (&ForeignItem<'_>, Option<Symbol>)[src]fn clean(&self, cx: &mut DocContext<'_>) -> Item[src]
impl Clean<Item> for (&MacroDef<'_>, Option<Symbol>)[src]
impl Clean<Item> for (&MacroDef<'_>, Option<Symbol>)[src]fn clean(&self, cx: &mut DocContext<'_>) -> Item[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> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>, pub fn vzip(self) -> V
impl<T> WithConstness for T[src]
impl<T> WithConstness for T[src]fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]
fn with_const(self) -> ConstnessAnd<Self>[src]
fn without_const(self) -> ConstnessAnd<Self>[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,