pub(super) struct LinkCollection {
visited: FxHashMap<ResolutionInfo, Option<(Res, Option<UrlFragment>)>>,
ambiguous: FxIndexMap<(ItemId, String), Vec<AmbiguousLinks>>,
}Fields§
§visited: FxHashMap<ResolutionInfo, Option<(Res, Option<UrlFragment>)>>Cache the resolved links so we can avoid resolving (and emitting errors for) the same link.
The link will be None if it could not be resolved (i.e. the error was cached).
ambiguous: FxIndexMap<(ItemId, String), Vec<AmbiguousLinks>>According to rustc_resolve, these links are ambiguous.
However, we cannot link to an item that has been stripped from the documentation. If all
but one of the “possibilities” are stripped, then there is no real ambiguity. To determine
if an ambiguity is real, we delay resolving them until after Cache::populate, then filter
every item that doesn’t have a cached path.
We could get correct results by simply delaying everything. This would have fewer happy codepaths, but we want to distinguish different kinds of error conditions, and this is easy to do by resolving links as soon as possible.
Trait Implementations§
Source§impl Default for LinkCollection
impl Default for LinkCollection
Source§fn default() -> LinkCollection
fn default() -> LinkCollection
Auto Trait Implementations§
impl DynSend for LinkCollection
impl DynSync for LinkCollection
impl Freeze for LinkCollection
impl RefUnwindSafe for LinkCollection
impl Send for LinkCollection
impl Sync for LinkCollection
impl Unpin for LinkCollection
impl UnsafeUnpin for LinkCollection
impl UnwindSafe for LinkCollection
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn 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>,
§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: 88 bytes