Trait sqruff_lib::core::templaters::base::Templater

source ·
pub trait Templater: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn template_selection(&self) -> &str;
    fn config_pairs(&self) -> (String, String);
    fn sequence_files(
        &self,
        f_names: Vec<String>,
        config: Option<&FluffConfig>,
        formatter: Option<&OutputStreamFormatter>,
    ) -> Vec<String>;
    fn process(
        &self,
        in_str: &str,
        f_name: &str,
        config: Option<&FluffConfig>,
        formatter: Option<&OutputStreamFormatter>,
    ) -> Result<TemplatedFile, SQLFluffUserError>;
}

Required Methods§

source

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

The name of the templater.

source

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

Description of the templater.

source

fn template_selection(&self) -> &str

Template Selector

source

fn config_pairs(&self) -> (String, String)

Returns info about the given templater for output by the cli.

source

fn sequence_files( &self, f_names: Vec<String>, config: Option<&FluffConfig>, formatter: Option<&OutputStreamFormatter>, ) -> Vec<String>

Given files to be processed, return a valid processing sequence.

source

fn process( &self, in_str: &str, f_name: &str, config: Option<&FluffConfig>, formatter: Option<&OutputStreamFormatter>, ) -> Result<TemplatedFile, SQLFluffUserError>

Process a string and return a TemplatedFile.

Implementors§