pub struct SumAccumulator { /* private fields */ }Expand description
Accumulator for SQL sum() aggregate with SQLite overflow semantics.
Unlike expression arithmetic (which promotes to REAL on overflow), sum()
raises an error on integer overflow. This matches C sqlite3 behavior.
Implementations§
Source§impl SumAccumulator
impl SumAccumulator
Sourcepub fn accumulate(&mut self, val: &SqliteValue)
pub fn accumulate(&mut self, val: &SqliteValue)
Add a value to the running sum.
Sourcepub fn finish(&self) -> Result<SqliteValue, SumOverflowError>
pub fn finish(&self) -> Result<SqliteValue, SumOverflowError>
Finalize the sum. Returns Err if integer overflow occurred,
Ok(NULL) if no non-NULL values were seen, or the sum value.
Trait Implementations§
Source§impl Clone for SumAccumulator
impl Clone for SumAccumulator
Source§fn clone(&self) -> SumAccumulator
fn clone(&self) -> SumAccumulator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SumAccumulator
impl Debug for SumAccumulator
Auto Trait Implementations§
impl Freeze for SumAccumulator
impl RefUnwindSafe for SumAccumulator
impl Send for SumAccumulator
impl Sync for SumAccumulator
impl Unpin for SumAccumulator
impl UnsafeUnpin for SumAccumulator
impl UnwindSafe for SumAccumulator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).