pub trait WindowFunction: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn info(&self) -> FunctionInfo;
fn process(
&self,
partition: &[Value],
order_by: &[Value],
current_row: usize,
) -> Result<Value>;
fn clone_box(&self) -> Box<dyn WindowFunction>;
}Expand description
Trait for window functions
Required Methods§
Sourcefn info(&self) -> FunctionInfo
fn info(&self) -> FunctionInfo
Get function information
Sourcefn process(
&self,
partition: &[Value],
order_by: &[Value],
current_row: usize,
) -> Result<Value>
fn process( &self, partition: &[Value], order_by: &[Value], current_row: usize, ) -> Result<Value>
Process the window function
§Arguments
partition- The partition of valuesorder_by- The ordering keyscurrent_row- The current row index (0-based)
Sourcefn clone_box(&self) -> Box<dyn WindowFunction>
fn clone_box(&self) -> Box<dyn WindowFunction>
Clone the function into a new instance