Skip to main content

TextTransform

Trait TextTransform 

Source
pub trait TextTransform: Send + Sync {
    // Required method
    fn transform(&self, text: Text) -> Result<Text, PluginError>;
}
Expand description

Rewrites a Text: keeps some lines, styles matches, masks secrets. Registered under a name with PluginRegistrar::transform; a host chains named transforms into a pipeline.

The text comes from the input being rendered, so treat it as untrusted. Change styles freely; text a transform adds must not carry terminal control sequences.

Required Methods§

Source

fn transform(&self, text: Text) -> Result<Text, PluginError>

Transform text. Errors should say what was wrong with the input.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: TextTransform + ?Sized> TextTransform for Arc<T>

Implementors§