Docs for new aux api

This commit is contained in:
Thom Chiovoloni 2020-04-12 19:46:17 -07:00 committed by Thom Chiovoloni
parent 2ef3628dac
commit 1b27ce0541

View File

@ -109,7 +109,6 @@ unsafe extern "C" fn free_boxed_value<T>(p: *mut c_void) {
pub struct Context<'a> { pub struct Context<'a> {
ctx: *mut sqlite3_context, ctx: *mut sqlite3_context,
args: &'a [*mut sqlite3_value], args: &'a [*mut sqlite3_value],
// conn: PhantomData<&'conn mut Connection>,
} }
impl Context<'_> { impl Context<'_> {
@ -163,6 +162,12 @@ impl Context<'_> {
unsafe { ValueRef::from_value(arg) } unsafe { ValueRef::from_value(arg) }
} }
/// Fetch or insert the the auxilliary data associated with a particular
/// parameter. This is intended to be an easier-to-use way of fetching it
/// compared to calling `get_aux` and `set_aux` separately.
///
/// See https://www.sqlite.org/c3ref/get_auxdata.html for a discussion of
/// this feature, or the unit tests of this module for an example.
pub fn get_or_create_aux<T, E, F>(&self, arg: c_int, func: F) -> Result<Arc<T>> pub fn get_or_create_aux<T, E, F>(&self, arg: c_int, func: F) -> Result<Arc<T>>
where where
T: Send + Sync + 'static, T: Send + Sync + 'static,