Skip to main content

TokenFilter

Trait TokenFilter 

Source
pub trait TokenFilter:
    'static
    + Send
    + Sync
    + TokenFilterClone {
    // Required methods
    fn name(&self) -> &'static str;
    fn apply(&self, tokens: &mut Vec<Token<'_>>) -> LinderaResult<()>;
}
Expand description

A trait for token filters that can be applied to a vector of tokens.

This trait requires the implementor to be 'static, Send, Sync, and implement the TokenFilterClone trait. It provides methods to get the name of the filter and to apply the filter to a mutable vector of tokens.

§Required Methods

  • name: Returns the name of the token filter as a static string slice.
  • apply: Applies the token filter to a mutable vector of tokens, returning a LinderaResult<()>.

Required Methods§

Source

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

Source

fn apply(&self, tokens: &mut Vec<Token<'_>>) -> LinderaResult<()>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§