pub struct Rows<'stmt> { /* private fields */ }
Expand description
An handle for the resulting rows of a query.
Implementations§
source§impl<'stmt> Rows<'stmt>
impl<'stmt> Rows<'stmt>
sourcepub fn next<'a>(&'a mut self) -> Option<Result<Row<'a, 'stmt>>>
pub fn next<'a>(&'a mut self) -> Option<Result<Row<'a, 'stmt>>>
Attempt to get the next row from the query. Returns Some(Ok(Row))
if
there is another row, Some(Err(...))
if there was an error
getting the next row, and None
if all rows have been retrieved.
Note
This interface is not compatible with Rust’s Iterator
trait, because
the lifetime of the returned row is tied to the lifetime of self
.
This is a “streaming iterator”. For a more natural interface,
consider using query_map
or query_and_then
instead, which
return types that implement Iterator
.