mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 19:41:37 +08:00
clippy::doc_markdown
This commit is contained in:
parent
98b3d84fa5
commit
01c4be82c8
@ -64,17 +64,17 @@ pub enum DbConfig {
|
|||||||
impl Connection {
|
impl Connection {
|
||||||
/// Returns the current value of a `config`.
|
/// Returns the current value of a `config`.
|
||||||
///
|
///
|
||||||
/// - SQLITE_DBCONFIG_ENABLE_FKEY: return `false` or `true` to indicate
|
/// - `SQLITE_DBCONFIG_ENABLE_FKEY`: return `false` or `true` to indicate
|
||||||
/// whether FK enforcement is off or on
|
/// whether FK enforcement is off or on
|
||||||
/// - SQLITE_DBCONFIG_ENABLE_TRIGGER: return `false` or `true` to indicate
|
/// - `SQLITE_DBCONFIG_ENABLE_TRIGGER`: return `false` or `true` to indicate
|
||||||
/// whether triggers are disabled or enabled
|
/// whether triggers are disabled or enabled
|
||||||
/// - SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER: return `false` or `true` to
|
/// - `SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER`: return `false` or `true` to
|
||||||
/// indicate whether fts3_tokenizer are disabled or enabled
|
/// indicate whether `fts3_tokenizer` are disabled or enabled
|
||||||
/// - SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE: return `false` to indicate
|
/// - `SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE`: return `false` to indicate
|
||||||
/// checkpoints-on-close are not disabled or `true` if they are
|
/// checkpoints-on-close are not disabled or `true` if they are
|
||||||
/// - SQLITE_DBCONFIG_ENABLE_QPSG: return `false` or `true` to indicate
|
/// - `SQLITE_DBCONFIG_ENABLE_QPSG`: return `false` or `true` to indicate
|
||||||
/// whether the QPSG is disabled or enabled
|
/// whether the QPSG is disabled or enabled
|
||||||
/// - SQLITE_DBCONFIG_TRIGGER_EQP: return `false` to indicate
|
/// - `SQLITE_DBCONFIG_TRIGGER_EQP`: return `false` to indicate
|
||||||
/// output-for-trigger are not disabled or `true` if it is
|
/// output-for-trigger are not disabled or `true` if it is
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn db_config(&self, config: DbConfig) -> Result<bool> {
|
pub fn db_config(&self, config: DbConfig) -> Result<bool> {
|
||||||
@ -93,17 +93,17 @@ impl Connection {
|
|||||||
|
|
||||||
/// Make configuration changes to a database connection
|
/// Make configuration changes to a database connection
|
||||||
///
|
///
|
||||||
/// - SQLITE_DBCONFIG_ENABLE_FKEY: `false` to disable FK enforcement, `true`
|
/// - `SQLITE_DBCONFIG_ENABLE_FKEY`: `false` to disable FK enforcement, `true`
|
||||||
/// to enable FK enforcement
|
/// to enable FK enforcement
|
||||||
/// - SQLITE_DBCONFIG_ENABLE_TRIGGER: `false` to disable triggers, `true` to
|
/// - `SQLITE_DBCONFIG_ENABLE_TRIGGER`: `false` to disable triggers, `true` to
|
||||||
/// enable triggers
|
/// enable triggers
|
||||||
/// - SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER: `false` to disable
|
/// - `SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER`: `false` to disable
|
||||||
/// fts3_tokenizer(), `true` to enable fts3_tokenizer()
|
/// `fts3_tokenizer()`, `true` to enable `fts3_tokenizer()`
|
||||||
/// - SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE: `false` (the default) to enable
|
/// - `SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE`: `false` (the default) to enable
|
||||||
/// checkpoints-on-close, `true` to disable them
|
/// checkpoints-on-close, `true` to disable them
|
||||||
/// - SQLITE_DBCONFIG_ENABLE_QPSG: `false` to disable the QPSG, `true` to
|
/// - `SQLITE_DBCONFIG_ENABLE_QPSG`: `false` to disable the QPSG, `true` to
|
||||||
/// enable QPSG
|
/// enable QPSG
|
||||||
/// - SQLITE_DBCONFIG_TRIGGER_EQP: `false` to disable output for trigger
|
/// - `SQLITE_DBCONFIG_TRIGGER_EQP`: `false` to disable output for trigger
|
||||||
/// programs, `true` to enable it
|
/// programs, `true` to enable it
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_db_config(&self, config: DbConfig, new_val: bool) -> Result<bool> {
|
pub fn set_db_config(&self, config: DbConfig, new_val: bool) -> Result<bool> {
|
||||||
|
@ -287,7 +287,7 @@ where
|
|||||||
fn finalize(&self, _: &mut Context<'_>, _: Option<A>) -> Result<T>;
|
fn finalize(&self, _: &mut Context<'_>, _: Option<A>) -> Result<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// WindowAggregate is the callback interface for
|
/// `WindowAggregate` is the callback interface for
|
||||||
/// user-defined aggregate window function.
|
/// user-defined aggregate window function.
|
||||||
#[cfg(feature = "window")]
|
#[cfg(feature = "window")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "window")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "window")))]
|
||||||
|
@ -367,8 +367,8 @@ impl Connection {
|
|||||||
///
|
///
|
||||||
/// The callback parameters are:
|
/// The callback parameters are:
|
||||||
///
|
///
|
||||||
/// - the type of database update (SQLITE_INSERT, SQLITE_UPDATE or
|
/// - the type of database update (`SQLITE_INSERT`, `SQLITE_UPDATE` or
|
||||||
/// SQLITE_DELETE),
|
/// `SQLITE_DELETE`),
|
||||||
/// - the name of the database ("main", "temp", ...),
|
/// - the name of the database ("main", "temp", ...),
|
||||||
/// - the name of the table that is updated,
|
/// - the name of the table that is updated,
|
||||||
/// - the ROWID of the row that is updated.
|
/// - the ROWID of the row that is updated.
|
||||||
|
@ -450,7 +450,7 @@ impl Connection {
|
|||||||
///
|
///
|
||||||
/// # Failure
|
/// # Failure
|
||||||
///
|
///
|
||||||
/// Will return `Err` if vfs` cannot be converted to a C-compatible
|
/// Will return `Err` if `vfs` cannot be converted to a C-compatible
|
||||||
/// string or if the underlying SQLite open call fails.
|
/// string or if the underlying SQLite open call fails.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn open_in_memory_with_flags_and_vfs(flags: OpenFlags, vfs: &str) -> Result<Connection> {
|
pub fn open_in_memory_with_flags_and_vfs(flags: OpenFlags, vfs: &str) -> Result<Connection> {
|
||||||
|
@ -99,7 +99,7 @@ use sealed::Sealed;
|
|||||||
///
|
///
|
||||||
/// - As a slice of `&[(&str, &dyn ToSql)]`. This is what essentially all of
|
/// - As a slice of `&[(&str, &dyn ToSql)]`. This is what essentially all of
|
||||||
/// these boil down to in the end, conceptually at least. In theory you can
|
/// these boil down to in the end, conceptually at least. In theory you can
|
||||||
/// pass this as `stmt.
|
/// pass this as `stmt`.
|
||||||
///
|
///
|
||||||
/// - As array references, similar to the positional params. This looks like
|
/// - As array references, similar to the positional params. This looks like
|
||||||
/// `thing.query(&[(":foo", &1i32), (":bar", &2i32)])` or
|
/// `thing.query(&[(":foo", &1i32), (":bar", &2i32)])` or
|
||||||
|
@ -187,7 +187,7 @@ where
|
|||||||
|
|
||||||
/// `FallibleStreamingIterator` differs from the standard library's `Iterator`
|
/// `FallibleStreamingIterator` differs from the standard library's `Iterator`
|
||||||
/// in two ways:
|
/// in two ways:
|
||||||
/// * each call to `next` (sqlite3_step) can fail.
|
/// * each call to `next` (`sqlite3_step`) can fail.
|
||||||
/// * returned `Row` is valid until `next` is called again or `Statement` is
|
/// * returned `Row` is valid until `next` is called again or `Statement` is
|
||||||
/// reset or finalized.
|
/// reset or finalized.
|
||||||
///
|
///
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use smallvec::{smallvec, SmallVec};
|
use smallvec::{smallvec, SmallVec};
|
||||||
use std::ffi::{CStr, CString, NulError};
|
use std::ffi::{CStr, CString, NulError};
|
||||||
|
|
||||||
/// Similar to std::ffi::CString, but avoids heap allocating if the string is
|
/// Similar to `std::ffi::CString`, but avoids heap allocating if the string is
|
||||||
/// small enough. Also guarantees it's input is UTF-8 -- used for cases where we
|
/// small enough. Also guarantees it's input is UTF-8 -- used for cases where we
|
||||||
/// need to pass a NUL-terminated string to SQLite, and we have a `&str`.
|
/// need to pass a NUL-terminated string to SQLite, and we have a `&str`.
|
||||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
@ -31,7 +31,7 @@ impl SmallCString {
|
|||||||
/// Get the bytes not including the NUL terminator. E.g. the bytes which
|
/// Get the bytes not including the NUL terminator. E.g. the bytes which
|
||||||
/// make up our `str`:
|
/// make up our `str`:
|
||||||
/// - `SmallCString::new("foo").as_bytes_without_nul() == b"foo"`
|
/// - `SmallCString::new("foo").as_bytes_without_nul() == b"foo"`
|
||||||
/// - `SmallCString::new("foo").as_bytes_with_nul() == b"foo\0"
|
/// - `SmallCString::new("foo").as_bytes_with_nul() == b"foo\0"`
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn as_bytes_without_nul(&self) -> &[u8] {
|
pub fn as_bytes_without_nul(&self) -> &[u8] {
|
||||||
self.debug_checks();
|
self.debug_checks();
|
||||||
|
@ -38,7 +38,7 @@ pub(crate) struct SqliteMallocString {
|
|||||||
|
|
||||||
impl SqliteMallocString {
|
impl SqliteMallocString {
|
||||||
/// SAFETY: Caller must be certain that `m` a nul-terminated c string
|
/// SAFETY: Caller must be certain that `m` a nul-terminated c string
|
||||||
/// allocated by sqlite3_malloc, and that SQLite expects us to free it!
|
/// allocated by `sqlite3_malloc`, and that SQLite expects us to free it!
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(crate) unsafe fn from_raw_nonnull(ptr: NonNull<c_char>) -> Self {
|
pub(crate) unsafe fn from_raw_nonnull(ptr: NonNull<c_char>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
@ -48,7 +48,7 @@ impl SqliteMallocString {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// SAFETY: Caller must be certain that `m` a nul-terminated c string
|
/// SAFETY: Caller must be certain that `m` a nul-terminated c string
|
||||||
/// allocated by sqlite3_malloc, and that SQLite expects us to free it!
|
/// allocated by `sqlite3_malloc`, and that SQLite expects us to free it!
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(crate) unsafe fn from_raw(ptr: *mut c_char) -> Option<Self> {
|
pub(crate) unsafe fn from_raw(ptr: *mut c_char) -> Option<Self> {
|
||||||
NonNull::new(ptr).map(|p| Self::from_raw_nonnull(p))
|
NonNull::new(ptr).map(|p| Self::from_raw_nonnull(p))
|
||||||
@ -95,13 +95,13 @@ impl SqliteMallocString {
|
|||||||
/// If `s` contains internal NULs, we'll replace them with
|
/// If `s` contains internal NULs, we'll replace them with
|
||||||
/// `NUL_REPLACE_CHAR`.
|
/// `NUL_REPLACE_CHAR`.
|
||||||
///
|
///
|
||||||
/// Except for debug_asserts which may trigger during testing, this function
|
/// Except for `debug_assert`s which may trigger during testing, this function
|
||||||
/// never panics. If we hit integer overflow or the allocation fails, we
|
/// never panics. If we hit integer overflow or the allocation fails, we
|
||||||
/// call `handle_alloc_error` which aborts the program after calling a
|
/// call `handle_alloc_error` which aborts the program after calling a
|
||||||
/// global hook.
|
/// global hook.
|
||||||
///
|
///
|
||||||
/// This means it's safe to use in extern "C" functions even outside of
|
/// This means it's safe to use in extern "C" functions even outside of
|
||||||
/// catch_unwind.
|
/// `catch_unwind`.
|
||||||
pub(crate) fn from_str(s: &str) -> Self {
|
pub(crate) fn from_str(s: &str) -> Self {
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
let s = if s.as_bytes().contains(&0) {
|
let s = if s.as_bytes().contains(&0) {
|
||||||
|
@ -193,7 +193,7 @@ impl VTabConnection {
|
|||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// The first item in a struct implementing VTab must be
|
/// The first item in a struct implementing `VTab` must be
|
||||||
/// `rusqlite::sqlite3_vtab`, and the struct must be `#[repr(C)]`.
|
/// `rusqlite::sqlite3_vtab`, and the struct must be `#[repr(C)]`.
|
||||||
///
|
///
|
||||||
/// ```rust,ignore
|
/// ```rust,ignore
|
||||||
|
Loading…
Reference in New Issue
Block a user