pub struct LinkResolver<'a> {
export_map: &'a BTreeMap<String, String>,
}Expand description
Link resolver implementing Haddock-style resolution
Fields§
§export_map: &'a BTreeMap<String, String>Implementations§
Source§impl<'a> LinkResolver<'a>
impl<'a> LinkResolver<'a>
pub fn new(export_map: &'a BTreeMap<String, String>) -> Self
Sourcepub fn export_map(&self) -> &BTreeMap<String, String>
pub fn export_map(&self) -> &BTreeMap<String, String>
Get the export map for resolving type links
Sourcepub fn resolve_link(
&self,
item_fqn: &str,
current_module: &str,
) -> Option<(String, ItemKind)>
pub fn resolve_link( &self, item_fqn: &str, current_module: &str, ) -> Option<(String, ItemKind)>
Resolve a link using Haddock rules:
- If exported from current_module (incl. re-exports): link to current
- Else if exported from public module: link there
- Else (private module only): no link
Returns (doc_module, item_kind) if linkable, None otherwise
Sourcefn is_private_module(&self, module_name: &str) -> bool
fn is_private_module(&self, module_name: &str) -> bool
Check if a module is private (has underscore segments)
Sourcepub fn resolve_attribute_link(
&self,
class_name: &str,
attribute_name: &str,
current_module: &str,
) -> Option<LinkTarget>
pub fn resolve_attribute_link( &self, class_name: &str, attribute_name: &str, current_module: &str, ) -> Option<LinkTarget>
Resolve a link to a class attribute (e.g., “C.C1” → link to C1 variant of class C)
This is used for linking to enum variants or class attributes in default values.
Auto Trait Implementations§
impl<'a> Freeze for LinkResolver<'a>
impl<'a> RefUnwindSafe for LinkResolver<'a>
impl<'a> Send for LinkResolver<'a>
impl<'a> Sync for LinkResolver<'a>
impl<'a> Unpin for LinkResolver<'a>
impl<'a> UnwindSafe for LinkResolver<'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
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>
Converts
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>
Converts
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