pub trait ToContextResult: Sealed { }Expand description
A value that can be returned from an SQL function.
There are several useful implementations available:
- For nullable values, Option<ToContextResult> provides an implementation.
- For fallible functions, Result<ToContextResult> provides an implementation.
- For arbitrary Rust objects, PassedRef provides an implementation.
- For borrowed SQLite values, &ValueRef provides an implementation. Note that you have to
reborrow as immutable in most cases:
&*value_ref. - For owned types known only at run-time, Value provides an implementation.
Implementations on Foreign Types§
impl ToContextResult for &'static str
Assign a static string to the context result.
impl ToContextResult for bool
impl ToContextResult for f64
impl ToContextResult for i32
impl ToContextResult for i64
impl ToContextResult for ()
Assign NULL to the context result.
impl ToContextResult for String
Assign an owned string to the context result.
impl<'a> ToContextResult for &'a [u8]
Sets the context result to the given BLOB.
impl<'a, const N: usize> ToContextResult for &'a [u8; N]
Sets the context result to the given BLOB.
impl<T: ToContextResult> ToContextResult for Option<T>
Sets the context result to the contained value or NULL.
Implementors§
impl ToContextResult for Error
Sets the context error to this error.
impl ToContextResult for Value
Sets a dynamically typed Value to the context result.
impl ToContextResult for Blob
impl<'a> ToContextResult for &'a ValueRef
Sets the context result to the contained value.
impl<'a> ToContextResult for &'a mut ValueRef
Sets the context result to the contained value.
impl<T: 'static + ?Sized> ToContextResult for UnsafePtr<T>
Sets an arbitrary pointer to the context result.
impl<T: 'static> ToContextResult for PassedRef<T>
Sets the context result to NULL with this value as an associated pointer.
impl<T: ToContextResult> ToContextResult for Result<T>
Sets either the context result or error, depending on the result.