pub(super) struct FullItemId {
def_id: DefId,
extra_id: Option<DefId>,
name: Option<Symbol>,
}
Expand description
An uninterned id.
Each one corresponds to exactly one of both:
rustdoc_json_types::Item
.rustdoc_json_types::Id
transitively (as eachItem
has anId
).
It’s broadly equivalent to a DefId
, but needs slightly more information
to fully disambiguate items, because sometimes we choose to split a single HIR
item into multiple JSON items, or have items with no corresponding HIR item.
Fields§
§def_id: DefId
The “main” id of the item.
In most cases this uniquely identifies the item, the other fields are just used for edge-cases.
extra_id: Option<DefId>
An extra DefId
, which we need for:
-
Auto-trait impls synthesized by rustdoc.
-
Blanket impls synthesized by rustdoc.
-
Splitting of reexports of multiple items.
E.g:
mod module { pub struct Foo {} // Exists in type namespace pub fn Foo(){} // Exists in value namespace } pub use module::Foo; // Imports both items
In HIR, the
pub use
is just 1 item, but in rustdoc-json it’s 2, so we need to disambiguate.
name: Option<Symbol>
Needed for #[rustc_doc_primitive]
modules.
For these, 1 DefId
is used for both the primitive and the fake-module
that holds its docs.
N.B. This only matters when documenting the standard library with
--document-private-items
. Maybe we should delete that module, and
remove this.
Trait Implementations§
Source§impl Clone for FullItemId
impl Clone for FullItemId
Source§fn clone(&self) -> FullItemId
fn clone(&self) -> FullItemId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FullItemId
impl Debug for FullItemId
Source§impl Hash for FullItemId
impl Hash for FullItemId
Source§impl PartialEq for FullItemId
impl PartialEq for FullItemId
impl Copy for FullItemId
impl Eq for FullItemId
impl StructuralPartialEq for FullItemId
Auto Trait Implementations§
impl Freeze for FullItemId
impl RefUnwindSafe for FullItemId
impl Send for FullItemId
impl Sync for FullItemId
impl Unpin for FullItemId
impl UnwindSafe for FullItemId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
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: 20 bytes