Merge pull request #757 from gwenn/iterators_doc

Try to explain why we need a map function
This commit is contained in:
gwenn 2020-06-03 19:04:51 +02:00 committed by GitHub
commit f04b4b62b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -95,6 +95,7 @@ impl Drop for Rows<'_> {
}
}
/// `F` is used to tranform the _streaming_ iterator into a _fallible_ iterator.
pub struct Map<'stmt, F> {
rows: Rows<'stmt>,
f: F,
@ -116,6 +117,8 @@ where
}
/// An iterator over the mapped resulting rows of a query.
///
/// `F` is used to tranform the _streaming_ iterator into a _standard_ iterator.
pub struct MappedRows<'stmt, F> {
rows: Rows<'stmt>,
map: F,

View File

@ -219,6 +219,8 @@ impl Statement<'_> {
/// Ok(names)
/// }
/// ```
/// `f` is used to tranform the _streaming_ iterator into a _standard_
/// iterator.
///
/// ## Failure
///
@ -256,6 +258,8 @@ impl Statement<'_> {
/// Ok(names)
/// }
/// ```
/// `f` is used to tranform the _streaming_ iterator into a _standard_
/// iterator.
///
/// ## Failure
///