pub struct DocRef<'a, T> { /* private fields */ }Implementations§
Source§impl<'a> DocRef<'a, Item>
impl<'a> DocRef<'a, Item>
pub fn name(&self) -> Option<&'a str>
pub fn inner(&self) -> &'a ItemEnum
pub fn path(&self) -> Option<Path<'a>>
pub fn summary(&self) -> Option<&'a ItemSummary>
pub fn find_child(&self, child_name: &str) -> Option<DocRef<'a, Item>>
pub fn find_by_path<'b>( &self, iter: impl Iterator<Item = &'b String>, ) -> Option<DocRef<'a, Item>>
Sourcepub fn discriminated_path(&self) -> Option<String>
pub fn discriminated_path(&self) -> Option<String>
Returns the fully-qualified, kind-discriminated path for this item, suitable for
round-tripping through Navigator::resolve_path.
For example, a Vec struct in std::vec returns "std::vec::struct@Vec", and the
vec module itself returns "std::mod@vec". The crate name is included as the first
segment; the discriminator (kind@) appears only on the final segment.
Uses crate_docs().name() (the Navigator’s canonical crate name) rather than
ItemSummary::path[0] (which rustdoc normalizes to underscores) so that the
generated path round-trips correctly through Navigator::resolve_path.
Returns None if the item has no ItemSummary entry in the crate’s paths map.
pub fn kind(&self) -> ItemKind
Source§impl<'a> DocRef<'a, ItemSummary>
impl<'a> DocRef<'a, ItemSummary>
Sourcepub fn external_crate(&self) -> Option<DocRef<'a, ExternalCrate>>
pub fn external_crate(&self) -> Option<DocRef<'a, ExternalCrate>>
Get the external crate this item summary refers to, if any. Returns None if crate_id == 0 (same crate).
Source§impl<'a> DocRef<'a, ExternalCrate>
impl<'a> DocRef<'a, ExternalCrate>
Sourcepub fn crate_name(&self) -> &'a str
pub fn crate_name(&self) -> &'a str
Get the canonical name of this external crate. Parses html_root_url if available, falls back to the name field.
Sourcepub fn load(&self) -> Option<&'a RustdocData>
pub fn load(&self) -> Option<&'a RustdocData>
Load the RustdocData for this external crate.
Source§impl<'a> DocRef<'a, Item>
impl<'a> DocRef<'a, Item>
pub fn methods(&self) -> MethodIter<'a> ⓘ
pub fn traits(&self) -> TraitIter<'a> ⓘ
pub fn child_items(&self) -> ChildItems<'a> ⓘ
Source§impl<'a> DocRef<'a, Item>
impl<'a> DocRef<'a, Item>
Sourcepub fn implementors(&self) -> ImplementorIter<'a> ⓘ
pub fn implementors(&self) -> ImplementorIter<'a> ⓘ
Iterate impl blocks in this crate that implement this trait.
Trait Implementations§
Source§impl<'a, T> From<&DocRef<'a, T>> for &'a RustdocData
impl<'a, T> From<&DocRef<'a, T>> for &'a RustdocData
Source§impl<'a, T> From<DocRef<'a, T>> for &'a RustdocData
impl<'a, T> From<DocRef<'a, T>> for &'a RustdocData
impl<'a, T> Copy for DocRef<'a, T>
impl<'a, T> Eq for DocRef<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for DocRef<'a, T>
impl<'a, T> !RefUnwindSafe for DocRef<'a, T>
impl<'a, T> Send for DocRef<'a, T>where
T: Sync,
impl<'a, T> Sync for DocRef<'a, T>where
T: Sync,
impl<'a, T> Unpin for DocRef<'a, T>
impl<'a, T> UnsafeUnpin for DocRef<'a, T>
impl<'a, T> !UnwindSafe for DocRef<'a, T>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.