pub trait SQLAggregateState: Send {
// Required methods
fn observe(&mut self, args: &[Value]) -> Result<(), SQLError>;
fn finish(&self) -> Result<Value, SQLError>;
// Provided method
fn close(&mut self) -> Result<(), SQLError> { ... }
}Expand description
Per-group state for a registered SQL aggregate function.
Required Methods§
fn observe(&mut self, args: &[Value]) -> Result<(), SQLError>
fn finish(&self) -> Result<Value, SQLError>
Provided Methods§
Sourcefn close(&mut self) -> Result<(), SQLError>
fn close(&mut self) -> Result<(), SQLError>
Release host resources after the last observation or value read. Execution
calls this once, including on failure, before completing the statement.
Resources must be released even when cleanup returns an error. finish
remains non-consuming because a window can read the same state repeatedly.
Existing Rust states may retain ordinary infallible Drop cleanup.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".