MCPcopy Create free account
hub / github.com/asg017/sqlite-loadable-rs / result_pointer

Function result_pointer

src/api.rs:365–376  ·  view source on GitHub ↗

[sqlite3_result_pointer](https://www.sqlite.org/bindptr.html)

(context: *mut sqlite3_context, name: &[u8], object: T)

Source from the content-addressed store, hash-verified

363
364/// [sqlite3_result_pointer](https://www.sqlite.org/bindptr.html)
365pub fn result_pointer<T>(context: *mut sqlite3_context, name: &[u8], object: T) {
366 let b = Box::new(object);
367 let pointer = Box::into_raw(b).cast::<c_void>();
368 unsafe {
369 sqlite3ext_result_pointer(
370 context,
371 pointer,
372 name.as_ptr().cast::<c_char>().cast_mut(),
373 Some(pointer_destroy::<T>),
374 )
375 };
376}
377
378// TODO maybe take in a Box<T>?
379/// [`sqlite3_set_auxdata`](https://www.sqlite.org/c3ref/get_auxdata.html)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected