[−][src]Struct rusqlite::functions::Context
feature = "functions"
Context is a wrapper for the SQLite function
evaluation context.
Implementations
impl<'_> Context<'_>
[src]
pub fn len(&self) -> usize
[src]
Returns the number of arguments to the function.
pub fn is_empty(&self) -> bool
[src]
Returns true
when there is no argument.
pub fn get<T: FromSql>(&self, idx: usize) -> Result<T>
[src]
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
.
pub fn get_raw(&self, idx: usize) -> ValueRef<'_>
[src]
Returns the idx
th argument as a ValueRef
.
Failure
Will panic if idx
is greater than or equal to self.len()
.
pub fn get_or_create_aux<T, E, F>(&self, arg: c_int, func: F) -> Result<Arc<T>> where
T: Send + Sync + 'static,
E: Into<Box<dyn Error + Send + Sync + 'static>>,
F: FnOnce(ValueRef<'_>) -> Result<T, E>,
[src]
T: Send + Sync + 'static,
E: Into<Box<dyn Error + Send + Sync + 'static>>,
F: FnOnce(ValueRef<'_>) -> Result<T, E>,
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 set_aux<T: Send + Sync + 'static>(
&self,
arg: c_int,
value: T
) -> Result<Arc<T>>
[src]
&self,
arg: c_int,
value: T
) -> Result<Arc<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.
pub fn get_aux<T: Send + Sync + 'static>(
&self,
arg: c_int
) -> Result<Option<Arc<T>>>
[src]
&self,
arg: c_int
) -> Result<Option<Arc<T>>>
Gets the auxilliary data that was associated with a given parameter via
set_aux
. Returns Ok(None)
if no data has been associated, and
Ok(Some(v)) if it has. Returns an error if the requested type does not
match.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> !Send for Context<'a>
impl<'a> !Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnwindSafe for Context<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,