pub struct QueryRowBatcher { /* private fields */ }Expand description
Incremental row emitter used by drivers that stream from the wire.
limit is the SQL result cap (from “limit SELECT results”). None means
stream every row. Batching is always applied regardless of limit.
Implementations§
Source§impl QueryRowBatcher
impl QueryRowBatcher
pub fn new( on_event: QueryStreamCallback, index: usize, sql: String, limit: Option<u32>, ) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
pub fn started(&self) -> bool
pub fn start(&mut self, columns: Vec<ColumnInfo>)
Sourcepub fn push(&mut self, row: Vec<Option<Value>>) -> bool
pub fn push(&mut self, row: Vec<Option<Value>>) -> bool
Push a decoded row. Returns false when the SQL result limit has been
exceeded; the extra row is not emitted and the caller should stop fetching.
pub fn finish(self, execution_time_ms: u64, rows_affected: Option<u64>)
Auto Trait Implementations§
impl !RefUnwindSafe for QueryRowBatcher
impl !UnwindSafe for QueryRowBatcher
impl Freeze for QueryRowBatcher
impl Send for QueryRowBatcher
impl Sync for QueryRowBatcher
impl Unpin for QueryRowBatcher
impl UnsafeUnpin for QueryRowBatcher
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