LinkTransformer

Trait LinkTransformer 

Source
pub trait LinkTransformer: Debug + DynClone {
    // Required methods
    fn apply(&self, link: &mut Link<'_>) -> Result<()>;
    fn tag(&self) -> String;

    // Provided methods
    fn pattern(&self) -> Regex { ... }
    fn strip_tag(&self) -> bool { ... }
}
Expand description

If a link transformer matches on a tag, it shall produce a meaningful regex-substituted transformation.

Required Methods§

Source

fn apply(&self, link: &mut Link<'_>) -> Result<()>

Apply the link transformation.

Source

fn tag(&self) -> String

Text on which the link transformer can operate shall start with this string.

Provided Methods§

Source

fn pattern(&self) -> Regex

Regex which will be applied to extract the salient part of the link destination.

Source

fn strip_tag(&self) -> bool

Implementors§