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§
sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Description of the templater.
sourcefn template_selection(&self) -> &str
fn template_selection(&self) -> &str
Template Selector
sourcefn config_pairs(&self) -> (String, String)
fn config_pairs(&self) -> (String, String)
Returns info about the given templater for output by the cli.
sourcefn sequence_files(
&self,
f_names: Vec<String>,
config: Option<&FluffConfig>,
formatter: Option<&OutputStreamFormatter>,
) -> Vec<String>
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.
sourcefn process(
&self,
in_str: &str,
f_name: &str,
config: Option<&FluffConfig>,
formatter: Option<&OutputStreamFormatter>,
) -> Result<TemplatedFile, SQLFluffUserError>
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.