Skip to main content

Accumulator

Trait Accumulator 

Source
pub trait Accumulator: Send {
    // Required methods
    fn update(&mut self, value: Option<SqlValue>) -> Result<()>;
    fn finalize(&self) -> Result<SqlValue>;
    fn clone_box(&self) -> Box<dyn Accumulator>;
}
Expand description

Accumulator interface for aggregate function execution.

Required Methods§

Source

fn update(&mut self, value: Option<SqlValue>) -> Result<()>

Update the accumulator with a new value (None for COUNT(*) rows).

Source

fn finalize(&self) -> Result<SqlValue>

Finalize the accumulator and return the resulting SqlValue.

Source

fn clone_box(&self) -> Box<dyn Accumulator>

Clone the accumulator as a trait object.

Trait Implementations§

Source§

impl Clone for Box<dyn Accumulator>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§