Skip to main content

SqlRowConsumer

Trait SqlRowConsumer 

Source
pub trait SqlRowConsumer: Send + 'static {
    // Required methods
    fn push_row(&mut self, row: SqlRow) -> StorageResult<()>;
    fn into_any(self: Box<Self>) -> Box<dyn Any + Send>;
}
Expand description

Owned state for consuming one SQL result in statement order.

A consumer must do bounded synchronous work and must not reenter SQL or wait for another operation on the same connection. Only private output should be accumulated: a failed query does not return the consumer, but cannot undo external side effects performed by it. Cancellation cannot preempt a blocked consumer; an interrupt hard-cap timeout may leave the worker owning it until that worker exits.

Required Methods§

Source

fn push_row(&mut self, row: SqlRow) -> StorageResult<()>

Consume one owned row, which may be dropped before the next row is read.

Source

fn into_any(self: Box<Self>) -> Box<dyn Any + Send>

Recover the concrete accumulator after a successful query. A failed downcast must be handled as a storage error by the caller.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§