From 1b27ce0541a136b50492a816550e170b9913803f Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Sun, 12 Apr 2020 19:46:17 -0700 Subject: [PATCH] Docs for new aux api --- src/functions.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/functions.rs b/src/functions.rs index 0c76244..b364f21 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -109,7 +109,6 @@ unsafe extern "C" fn free_boxed_value(p: *mut c_void) { pub struct Context<'a> { ctx: *mut sqlite3_context, args: &'a [*mut sqlite3_value], - // conn: PhantomData<&'conn mut Connection>, } impl Context<'_> { @@ -163,6 +162,12 @@ impl Context<'_> { 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(&self, arg: c_int, func: F) -> Result> where T: Send + Sync + 'static,