Skip to main content

LinkFormatter

Trait LinkFormatter 

Source
pub trait LinkFormatter: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn format(&self, target: &LinkTarget, ctx: &LinkContext) -> String;
}
Expand description

Format a resolved link target for one output format (sync, no I/O).

Renderer crates implement this to turn LinkTarget values into markdown links, using LinkContext for relative path resolution.

Required Methods§

Source

fn name(&self) -> &'static str

Short formatter name (e.g. "markdown-relative").

Source

fn format(&self, target: &LinkTarget, ctx: &LinkContext) -> String

Formats target as a link string appropriate for the output format.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§