pub struct Context<'a> { /* private fields */ }
Expand description
Context is a wrapper for the SQLite function evaluation context.
Implementations§
source§impl<'a> Context<'a>
impl<'a> Context<'a>
sourcepub fn get<T: FromSql>(&self, idx: usize) -> Result<T>
pub fn get<T: FromSql>(&self, idx: usize) -> Result<T>
Returns the idx
th argument as a T
.
Failure
Will panic if idx
is greater than or equal to self.len()
.
Will return Err if the underlying SQLite type cannot be converted to a
T
.
sourcepub fn get_raw(&self, idx: usize) -> ValueRef<'a>
pub fn get_raw(&self, idx: usize) -> ValueRef<'a>
Returns the idx
th argument as a ValueRef
.
Failure
Will panic if idx
is greater than or equal to self.len()
.
sourcepub fn set_aux<T>(&self, arg: c_int, value: T)
pub fn set_aux<T>(&self, arg: c_int, value: T)
Sets the auxilliary data associated with a particular parameter. 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.
sourcepub unsafe fn get_aux<T>(&self, arg: c_int) -> Option<&T>
pub unsafe fn get_aux<T>(&self, arg: c_int) -> Option<&T>
Gets the auxilliary data that was associated with a given parameter
via set_aux
. Returns None
if no data has been associated.
Unsafety
This function is unsafe as there is no guarantee that the type T
requested matches the type T
that was provided to set_aux
. The
types must be identical.