mirror of
https://github.com/isar/rusqlite.git
synced 2025-12-19 09:55:09 +08:00
Document which features are required, and add vtab usage examples (#669)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//! Add, remove, or modify a collation
|
||||
//! `feature = "collation"` Add, remove, or modify a collation
|
||||
use std::cmp::Ordering;
|
||||
use std::os::raw::{c_char, c_int, c_void};
|
||||
use std::panic::{catch_unwind, UnwindSafe};
|
||||
@@ -14,7 +14,7 @@ unsafe extern "C" fn free_boxed_value<T>(p: *mut c_void) {
|
||||
}
|
||||
|
||||
impl Connection {
|
||||
/// Add or modify a collation.
|
||||
/// `feature = "collation"` Add or modify a collation.
|
||||
pub fn create_collation<C>(&self, collation_name: &str, x_compare: C) -> Result<()>
|
||||
where
|
||||
C: Fn(&str, &str) -> Ordering + Send + UnwindSafe + 'static,
|
||||
@@ -24,7 +24,7 @@ impl Connection {
|
||||
.create_collation(collation_name, x_compare)
|
||||
}
|
||||
|
||||
/// Collation needed callback
|
||||
/// `feature = "collation"` Collation needed callback
|
||||
pub fn collation_needed(
|
||||
&self,
|
||||
x_coll_needed: fn(&Connection, &str) -> Result<()>,
|
||||
@@ -32,7 +32,7 @@ impl Connection {
|
||||
self.db.borrow_mut().collation_needed(x_coll_needed)
|
||||
}
|
||||
|
||||
/// Remove collation.
|
||||
/// `feature = "collation"` Remove collation.
|
||||
pub fn remove_collation(&self, collation_name: &str) -> Result<()> {
|
||||
self.db.borrow_mut().remove_collation(collation_name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user