Skip to main content

Rows

Struct Rows 

Source
pub struct Rows<'c, 's, C: ColumnIndexes, S = Binding<'c, 's>>
where S: Execute<'c, 's>, 'c: 's,
{ /* private fields */ }
Expand description

Access the Columns of each row returned by a query.

Implementations§

Source§

impl<'c, 's, 'r, C, S> Rows<'c, 's, C, S>
where C: Columns<'r>, S: Execute<'c, 's>, 'c: 's, 's: 'r,

Source

pub fn next(&'r mut self) -> Result<Option<C>>

Fetch the next row.

If fetching fails, returns an error. If no more rows are available, returns Ok(None). Otherwise, returns Ok(Some(C)).

Source

pub fn map<F, T: 's>(self, f: F) -> Map<'c, 's, C, F, S>
where F: FnMut(C) -> T,

Call a closure to transform each row in the result set.

Like Iterator::map, but can map over Columns which borrow data from the SQLite row. The returned T must not borrow from the row.

Source

pub fn filter_map<F, T: 's>(self, f: F) -> FilterMap<'c, 's, C, F, S>
where F: FnMut(C) -> Option<T>,

Call a closure to transform each row in the result set into an Option, and filter out any rows where the closure returned None.

Like Iterator::filter_map, but can map over Columns which borrow data from the SQLite row. The returned T must not borrow from the row.

Trait Implementations§

Source§

impl<'c, 's, C: Debug + ColumnIndexes, S> Debug for Rows<'c, 's, C, S>
where S: Execute<'c, 's> + Debug, C::Indexes: Debug, 'c: 's,

Source§

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

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

impl<'c, 's, C, S> IntoIterator for Rows<'c, 's, C, S>
where C: for<'r> Columns<'r> + 'static, S: Execute<'c, 's>, 'c: 's,

Source§

type Item = Result<C, Error>

The type of the elements being iterated over.
Source§

type IntoIter = RowsIterator<'c, 's, C, S>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'c, 's, C, S> Freeze for Rows<'c, 's, C, S>
where <C as ColumnIndexes>::Indexes: Freeze, S: Freeze,

§

impl<'c, 's, C, S> RefUnwindSafe for Rows<'c, 's, C, S>

§

impl<'c, 's, C, S> Send for Rows<'c, 's, C, S>
where <C as ColumnIndexes>::Indexes: Send, S: Send,

§

impl<'c, 's, C, S> Sync for Rows<'c, 's, C, S>
where <C as ColumnIndexes>::Indexes: Sync, S: Sync,

§

impl<'c, 's, C, S> Unpin for Rows<'c, 's, C, S>
where <C as ColumnIndexes>::Indexes: Unpin, S: Unpin,

§

impl<'c, 's, C, S> UnsafeUnpin for Rows<'c, 's, C, S>

§

impl<'c, 's, C, S = Binding<'c, 's>> !UnwindSafe for Rows<'c, 's, C, S>

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.