Skip to main content

RowIter

Struct RowIter 

Source
pub struct RowIter<'t> { /* private fields */ }
Expand description

Iterator over rows of a table.

This is an in-flight type and is !Send + !Sync (thread-affine).

Rows are produced via RowIter::next, which invokes a callback with a borrowed slice of CellRef.

Implementations§

Source§

impl<'t> RowIter<'t>

Source

pub fn next<F>(&mut self, on_row: F) -> Result<bool>
where F: for<'row> FnOnce(&[CellRef<'row>]) -> Result<()>,

Advance to the next row and invoke on_row.

Returns:

  • Ok(true) if a row was produced and on_row was called
  • Ok(false) if the iterator is exhausted
§Lifetimes

For CellRef::Text and CellRef::Json, the returned byte slices remain valid until the next call to RowIter::next on the same iterator (or until the iterator is dropped).

§Errors

Returns an Error if the runtime reports an error while advancing.

Trait Implementations§

Source§

impl Drop for RowIter<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'t> Freeze for RowIter<'t>

§

impl<'t> RefUnwindSafe for RowIter<'t>

§

impl<'t> !Send for RowIter<'t>

§

impl<'t> !Sync for RowIter<'t>

§

impl<'t> Unpin for RowIter<'t>

§

impl<'t> UnsafeUnpin for RowIter<'t>

§

impl<'t> !UnwindSafe for RowIter<'t>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.