pub trait FilterGenExt {
    type Params: Default;

    const KEY: &'static str;
    const FMT: Option<&'static str>;

    fn parse_args(parser: Option<Parser<'_>>) -> Option<FilterGen>;
    fn add_help(s: &mut String);
    fn work(data: &Data, params: Self::Params) -> Res<(Filters, Vec<Chart>)>;
}
Expand description

Trait implemented by filter generation techniques.

This trait represents the info needed by FilterGen to

  • parse_args, KEY: parse the arguments of the --filter_gen flag,
  • add_help: generate the part of the help message for --filter_gen specific to this filter generator,
  • KEY, FMT: generate relevant error messages during CLAP, and
  • work actually run the generator.

Required Associated Types

Type of the parameters of the filter generator.

Required Associated Constants

CLAP key activating this generator.

Optional parameter format, should be a list of comma-separated <id>: <value> bindings.

Required Methods

Parses the (potentialy optional) parameters for the generator.

Simply returns None if parameters are ill-formed. Caller’s responsible for error reporting.

Adds help about itself to a String.

See AllocSite’s implementation of this function to get an idea of the format.

Runs the generator on some data given some parameters.

Implementors