Skip to main content

LinkResolver

Trait LinkResolver 

Source
pub trait LinkResolver: Send + Sync {
    // Required method
    fn resolve<'a>(
        &'a self,
        link: &'a str,
        source_path: Option<&'a str>,
    ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'a>>;
}
Expand description

A handler for resolving internal links.

This allows the caller to provide custom link resolution logic, including dependency tracking for incremental rebuilds.

Required Methods§

Source

fn resolve<'a>( &'a self, link: &'a str, source_path: Option<&'a str>, ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'a>>

Resolve a link to its final URL.

§Arguments
  • link - The raw link from the markdown (e.g., @/guide/intro.md)
  • source_path - The path of the source file containing the link
§Returns
  • Some(url) - The resolved URL to use
  • None - Use the default link resolution logic

Implementors§