Use #[doc(cfg)]

Fix #835
This commit is contained in:
gwenn
2021-06-13 09:17:35 +02:00
parent ee7f7b89d5
commit 0312937d6a
23 changed files with 141 additions and 87 deletions

View File

@@ -1,4 +1,4 @@
//! `feature = "session"` [Session Extension](https://sqlite.org/sessionintro.html)
//! [Session Extension](https://sqlite.org/sessionintro.html)
#![allow(non_camel_case_types)]
use std::ffi::CStr;
@@ -19,7 +19,7 @@ use crate::{errmsg_to_string, str_to_cstring, Connection, DatabaseName, Result};
// https://sqlite.org/session.html
/// `feature = "session"` An instance of this object is a session that can be
/// An instance of this object is a session that can be
/// used to record changes to a database.
pub struct Session<'conn> {
phantom: PhantomData<&'conn Connection>,
@@ -223,7 +223,7 @@ impl Drop for Session<'_> {
}
}
/// `feature = "session"` Invert a changeset
/// Invert a changeset
#[inline]
pub fn invert_strm(input: &mut dyn Read, output: &mut dyn Write) -> Result<()> {
let input_ref = &input;
@@ -239,7 +239,7 @@ pub fn invert_strm(input: &mut dyn Read, output: &mut dyn Write) -> Result<()> {
Ok(())
}
/// `feature = "session"` Combine two changesets
/// Combine two changesets
#[inline]
pub fn concat_strm(
input_a: &mut dyn Read,
@@ -262,7 +262,7 @@ pub fn concat_strm(
Ok(())
}
/// `feature = "session"` Changeset or Patchset
/// Changeset or Patchset
pub struct Changeset {
cs: *mut c_void,
n: c_int,
@@ -313,7 +313,7 @@ impl Drop for Changeset {
}
}
/// `feature = "session"` Cursor for iterating over the elements of a changeset
/// Cursor for iterating over the elements of a changeset
/// or patchset.
pub struct ChangesetIter<'changeset> {
phantom: PhantomData<&'changeset Changeset>,
@@ -367,7 +367,7 @@ impl FallibleStreamingIterator for ChangesetIter<'_> {
}
}
/// `feature = "session"`
/// Operation
pub struct Operation<'item> {
table_name: &'item str,
number_of_columns: i32,
@@ -410,7 +410,7 @@ impl Drop for ChangesetIter<'_> {
}
}
/// `feature = "session"` An item passed to a conflict-handler by
/// An item passed to a conflict-handler by
/// [`Connection::apply`](crate::Connection::apply), or an item generated by
/// [`ChangesetIter::next`](ChangesetIter::next).
// TODO enum ? Delete, Insert, Update, ...
@@ -517,7 +517,7 @@ impl ChangesetItem {
}
}
/// `feature = "session"` Used to combine two or more changesets or
/// Used to combine two or more changesets or
/// patchsets
pub struct Changegroup {
cg: *mut ffi::sqlite3_changegroup,
@@ -587,7 +587,7 @@ impl Drop for Changegroup {
}
impl Connection {
/// `feature = "session"` Apply a changeset to a database
/// Apply a changeset to a database
pub fn apply<F, C>(&self, cs: &Changeset, filter: Option<F>, conflict: C) -> Result<()>
where
F: Fn(&str) -> bool + Send + RefUnwindSafe + 'static,
@@ -621,7 +621,7 @@ impl Connection {
Ok(())
}
/// `feature = "session"` Apply a changeset to a database
/// Apply a changeset to a database
pub fn apply_strm<F, C>(
&self,
input: &mut dyn Read,
@@ -662,7 +662,7 @@ impl Connection {
}
}
/// `feature = "session"` Constants passed to the conflict handler
/// Constants passed to the conflict handler
/// See [here](https://sqlite.org/session.html#SQLITE_CHANGESET_CONFLICT) for details.
#[allow(missing_docs)]
#[repr(i32)]
@@ -690,7 +690,7 @@ impl From<i32> for ConflictType {
}
}
/// `feature = "session"` Constants returned by the conflict handler
/// Constants returned by the conflict handler
/// See [here](https://sqlite.org/session.html#SQLITE_CHANGESET_ABORT) for details.
#[allow(missing_docs)]
#[repr(i32)]