Skip to main content

SQLAggregateState

Trait SQLAggregateState 

Source
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§

Source

fn observe(&mut self, args: &[Value]) -> Result<(), SQLError>

Source

fn finish(&self) -> Result<Value, SQLError>

Provided Methods§

Source

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".

Implementors§