Document which features are required, and add vtab usage examples (#669)

This commit is contained in:
Thom Chiovoloni
2020-04-05 22:15:27 -07:00
committed by GitHub
parent 6edf72857e
commit 6617db59fb
16 changed files with 164 additions and 97 deletions

View File

@@ -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)
}