This commit is contained in:
gwenn 2021-05-07 19:39:53 +02:00 committed by GitHub
parent 26f3e50f5a
commit cd40cc330b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 13 deletions

View File

@ -5,10 +5,10 @@
//! the destination (which cannot). A [`Backup`] handle exposes three methods: //! the destination (which cannot). A [`Backup`] handle exposes three methods:
//! [`step`](Backup::step) will attempt to back up a specified number of pages, //! [`step`](Backup::step) will attempt to back up a specified number of pages,
//! [`progress`](Backup::progress) gets the current progress of the backup as of //! [`progress`](Backup::progress) gets the current progress of the backup as of
//! the last call to [`step`](Backup::step), and [`run_to_completion`](Backup::run_to_completion) //! the last call to [`step`](Backup::step), and
//! will attempt to back up the entire source database, //! [`run_to_completion`](Backup::run_to_completion) will attempt to back up the
//! allowing you to specify how many pages are backed up at a time and how long //! entire source database, allowing you to specify how many pages are backed up
//! the thread should sleep between chunks of pages. //! at a time and how long the thread should sleep between chunks of pages.
//! //!
//! The following example is equivalent to "Example 2: Online Backup of a //! The following example is equivalent to "Example 2: Online Backup of a
//! Running Database" from [SQLite's Online Backup API //! Running Database" from [SQLite's Online Backup API

View File

@ -278,7 +278,8 @@ mod test {
/// reset) even if DB schema is altered (SQLite documentation is /// reset) even if DB schema is altered (SQLite documentation is
/// ambiguous here because it says reference "is valid until (...) the next /// ambiguous here because it says reference "is valid until (...) the next
/// call to sqlite3_column_name() or sqlite3_column_name16() on the same /// call to sqlite3_column_name() or sqlite3_column_name16() on the same
/// column.". We assume that reference is valid if only `sqlite3_column_name()` is used): /// column.". We assume that reference is valid if only
/// `sqlite3_column_name()` is used):
#[test] #[test]
#[cfg(feature = "modern_sqlite")] #[cfg(feature = "modern_sqlite")]
fn test_column_name_reference() -> Result<()> { fn test_column_name_reference() -> Result<()> {

View File

@ -105,7 +105,8 @@ impl Drop for Rows<'_> {
} }
} }
/// `F` is used to transform the _streaming_ iterator into a _fallible_ iterator. /// `F` is used to transform the _streaming_ iterator into a _fallible_
/// iterator.
#[must_use = "iterators are lazy and do nothing unless consumed"] #[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct Map<'stmt, F> { pub struct Map<'stmt, F> {
rows: Rows<'stmt>, rows: Rows<'stmt>,
@ -130,7 +131,8 @@ where
/// An iterator over the mapped resulting rows of a query. /// An iterator over the mapped resulting rows of a query.
/// ///
/// `F` is used to transform the _streaming_ iterator into a _standard_ iterator. /// `F` is used to transform the _streaming_ iterator into a _standard_
/// iterator.
#[must_use = "iterators are lazy and do nothing unless consumed"] #[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct MappedRows<'stmt, F> { pub struct MappedRows<'stmt, F> {
rows: Rows<'stmt>, rows: Rows<'stmt>,

View File

@ -137,8 +137,8 @@ impl Statement<'_> {
/// ///
/// Due to lifetime restricts, the rows handle returned by `query` does not /// Due to lifetime restricts, the rows handle returned by `query` does not
/// implement the `Iterator` trait. Consider using /// implement the `Iterator` trait. Consider using
/// [`query_map`](Statement::query_map) or [`query_and_then`](Statement::query_and_then) /// [`query_map`](Statement::query_map) or
/// instead, which do. /// [`query_and_then`](Statement::query_and_then) instead, which do.
/// ///
/// ## Example /// ## Example
/// ///
@ -521,8 +521,8 @@ impl Statement<'_> {
Ok(self.stmt.bind_parameter_index(name)) Ok(self.stmt.bind_parameter_index(name))
} }
/// Return the SQL parameter name given its (one-based) index (the inverse of /// Return the SQL parameter name given its (one-based) index (the inverse
/// [`Statement::parameter_index`]). /// of [`Statement::parameter_index`]).
/// ///
/// ```rust,no_run /// ```rust,no_run
/// # use rusqlite::{Connection, Result}; /// # use rusqlite::{Connection, Result};
@ -536,8 +536,8 @@ impl Statement<'_> {
/// ///
/// # Failure /// # Failure
/// ///
/// Will return `None` if the column index is out of bounds or if the parameter /// Will return `None` if the column index is out of bounds or if the
/// is positional. /// parameter is positional.
#[inline] #[inline]
pub fn parameter_name(&self, index: usize) -> Option<&'_ str> { pub fn parameter_name(&self, index: usize) -> Option<&'_ str> {
self.stmt.bind_parameter_name(index as i32).map(|name| { self.stmt.bind_parameter_name(index as i32).map(|name| {