pub trait Accumulator: Send {
// Required methods
fn update(&mut self, value: Option<SqlValue>) -> Result<()>;
fn state(&self) -> Result<Vec<SqlValue>>;
fn merge(&mut self, state: &[SqlValue]) -> Result<()>;
fn finalize(&self) -> Result<SqlValue>;
fn clone_box(&self) -> Box<dyn Accumulator>;
// Provided method
fn retained_bytes(&self) -> u64 { ... }
}Expand description
Accumulator interface for aggregate function execution.
Required Methods§
Sourcefn update(&mut self, value: Option<SqlValue>) -> Result<()>
fn update(&mut self, value: Option<SqlValue>) -> Result<()>
Update the accumulator with a new value (None for COUNT(*) rows).
Sourcefn merge(&mut self, state: &[SqlValue]) -> Result<()>
fn merge(&mut self, state: &[SqlValue]) -> Result<()>
Merge a partial state produced by an accumulator of the same function.
Sourcefn finalize(&self) -> Result<SqlValue>
fn finalize(&self) -> Result<SqlValue>
Finalize the accumulator and return the resulting SqlValue.
Sourcefn clone_box(&self) -> Box<dyn Accumulator>
fn clone_box(&self) -> Box<dyn Accumulator>
Clone the accumulator as a trait object.
Provided Methods§
Sourcefn retained_bytes(&self) -> u64
fn retained_bytes(&self) -> u64
Estimated bytes retained by dynamically allocated accumulator state.
Window execution uses this to charge the shared operator memory budget while an accumulator is alive.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".