pub struct LinkResolver<'a> { /* private fields */ }Expand description
A resolver for TypeRef paths to markdown file paths.
Implementations§
Source§impl<'a> LinkResolver<'a>
impl<'a> LinkResolver<'a>
Sourcepub fn new(schemas: &'a [DiscoveredSchema], base_url: Option<&'a str>) -> Self
pub fn new(schemas: &'a [DiscoveredSchema], base_url: Option<&'a str>) -> Self
Create a new link resolver from discovered schemas.
Sourcepub fn has_collision(&self, short_name: &str) -> bool
pub fn has_collision(&self, short_name: &str) -> bool
Check if a short name has collisions (multiple types with the same short name).
Sourcepub fn display_name(&self, type_path: &str) -> String
pub fn display_name(&self, type_path: &str) -> String
Get the display name for a type path. Returns the short name if unambiguous, otherwise the qualified path.
Sourcepub fn type_path_to_anchor(type_path: &str) -> String
pub fn type_path_to_anchor(type_path: &str) -> String
Convert a type path to an anchor ID for single-page mode. Uses the full path to guarantee uniqueness.
Sourcepub fn type_to_markdown(&self, type_kind: &TypeKind) -> String
pub fn type_to_markdown(&self, type_kind: &TypeKind) -> String
Format a TypeKind as a markdown string with links for TypeRefs.
Sourcepub fn type_to_markdown_anchor(&self, type_kind: &TypeKind) -> String
pub fn type_to_markdown_anchor(&self, type_kind: &TypeKind) -> String
Format a TypeKind as markdown with anchor links for single-page mode.
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