struct LinkCollector<'a, 'tcx> {
    cx: &'a mut DocContext<'tcx>,
    mod_ids: Vec<DefId>,
    visited_links: FxHashMap<ResolutionInfo, Option<(Res, Option<UrlFragment>)>>,
}

Fields§

§cx: &'a mut DocContext<'tcx>§mod_ids: Vec<DefId>

A stack of modules used to decide what scope to resolve in.

The last module will be used if the parent scope of the current item is unknown.

§visited_links: 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).

Implementations§

Given a full link, parse it as an enum struct variant.

In particular, this will return an error whenever there aren’t three full path segments left in the link.

Given a primitive type, try to resolve an associated item.

Convenience wrapper around resolve_rustdoc_path.

This also handles resolving true and false as booleans. NOTE: resolve_rustdoc_path knows only about paths, not about types. Associated items will never be resolved by this function.

Resolves a string as a path within a particular namespace. Returns an optional URL fragment in the case of variants and methods.

Convert a DefId to a Res, where possible.

This is used for resolving type aliases.

Convert a PrimitiveType to a Ty, where possible.

This is used for resolving trait impls for primitives

Resolve an associated item, returning its containing page’s Res and the fragment targeting the associated item on its page.

This is the entry point for resolving an intra-doc link.

FIXME(jynelson): this is way too many arguments

After parsing the disambiguator, resolve the main part of the link.

Trait Implementations§

don’t override!
don’t override!

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

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: 64 bytes