pub struct LinkContext<'a> {
pub krate: &'a Crate,
pub external_crate_index: HashMap<u32, ExternalCrateRef>,
}Expand description
Build a lookup table for intra-doc link resolution. Given an Item.links entry (label -> Id), we want the full path so the renderer can produce a sourcey URL or fall back to an external one.
Fields§
§krate: &'a Crate§external_crate_index: HashMap<u32, ExternalCrateRef>Implementations§
Source§impl<'a> LinkContext<'a>
impl<'a> LinkContext<'a>
pub fn new(krate: &'a Crate) -> Self
pub fn external_crates(&self) -> Vec<ExternalCrateRef>
pub fn resolve_id(&self, id: &Id) -> Option<ResolvedLink>
Auto Trait Implementations§
impl<'a> Freeze for LinkContext<'a>
impl<'a> RefUnwindSafe for LinkContext<'a>
impl<'a> Send for LinkContext<'a>
impl<'a> Sync for LinkContext<'a>
impl<'a> Unpin for LinkContext<'a>
impl<'a> UnsafeUnpin for LinkContext<'a>
impl<'a> UnwindSafe for LinkContext<'a>
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
Mutably borrows from an owned value. Read more