Skip to main content

BufferedReader

Struct BufferedReader 

Source
pub struct BufferedReader { /* private fields */ }
Expand description

A reader over an already-materialized batch, preserving result-set boundaries.

Providers and wrappers that materialize the bounded batch before returning use this. It has no unread wire results, so finish_async and has_next_set_async only discard the in-memory rows. Empty sets remain representable and countable.

Implementations§

Source§

impl BufferedReader

Source

pub fn new(rows: Vec<Row>) -> Self

Wraps owned rows as one result set.

Source

pub fn from_sets(sets: Vec<Vec<Row>>) -> Self

Wraps owned rows grouped by result set, including empty sets.

Trait Implementations§

Source§

impl Debug for BufferedReader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Reader for BufferedReader

Source§

fn next_row_async(&mut self) -> DbFuture<'_, Option<Row>>

Returns the next row in the current result set, or None at the set’s end. Read more
Source§

fn has_next_set_async(&mut self) -> DbFuture<'_, bool>

Advances to the next result set, discarding any unread rows in the current one. Read more
Source§

fn finish_async(&mut self) -> DbFuture<'_, ()>

Drains and discards every remaining row and result set. Read more
Source§

fn read_all_async(&mut self) -> DbFuture<'_, Vec<Row>>

Drains every result set and returns the owned rows, flattening set boundaries. Read more
Source§

fn read_sets_async(&mut self) -> DbFuture<'_, Vec<Vec<Row>>>

Drains every result set and returns the rows grouped by set, including empty sets. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.