mirror of
https://github.com/isar/rusqlite.git
synced 2025-11-06 09:48:58 +08:00
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user