LinkResolver

Struct LinkResolver 

Source
pub struct LinkResolver<'a> { /* private fields */ }
Expand description

A resolver for TypeRef paths to markdown file paths.

Implementations§

Source§

impl<'a> LinkResolver<'a>

Source

pub fn new(schemas: &'a [DiscoveredSchema], base_url: Option<&'a str>) -> Self

Create a new link resolver from discovered schemas.

Source

pub fn has_collision(&self, short_name: &str) -> bool

Check if a short name has collisions (multiple types with the same short name).

Source

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.

Source

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.

Source

pub fn type_to_markdown(&self, type_kind: &TypeKind) -> String

Format a TypeKind as a markdown string with links for TypeRefs.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.