TableGenerator

Trait TableGenerator 

Source
pub trait TableGenerator: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn columns(&self) -> Vec<DataColumn>;
    fn generate(&self, args: Vec<DataValue>) -> Result<Arc<DataTable>>;
    fn description(&self) -> &str;
    fn arg_count(&self) -> usize;
}
Expand description

Trait for table-generating functions that produce rows dynamically

Required Methods§

Source

fn name(&self) -> &str

Get the name of the generator function (e.g., “GENERATE_PRIMES”)

Source

fn columns(&self) -> Vec<DataColumn>

Get the column definitions for the generated table

Source

fn generate(&self, args: Vec<DataValue>) -> Result<Arc<DataTable>>

Generate the table based on the provided arguments Arguments are evaluated expressions from the SQL query

Source

fn description(&self) -> &str

Get a description of what this generator does

Source

fn arg_count(&self) -> usize

Get the expected number of arguments

Implementors§