Skip to main content

ToContextResult

Trait ToContextResult 

Source
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§

Source§

impl ToContextResult for &'static str

Assign a static string to the context result.

Source§

impl ToContextResult for bool

Source§

impl ToContextResult for f64

Source§

impl ToContextResult for i32

Source§

impl ToContextResult for i64

Source§

impl ToContextResult for ()

Assign NULL to the context result.

Source§

impl ToContextResult for String

Assign an owned string to the context result.

Source§

impl<'a> ToContextResult for &'a [u8]

Sets the context result to the given BLOB.

Source§

impl<'a, const N: usize> ToContextResult for &'a [u8; N]

Sets the context result to the given BLOB.

Source§

impl<T: ToContextResult> ToContextResult for Option<T>

Sets the context result to the contained value or NULL.

Implementors§

Source§

impl ToContextResult for Error

Sets the context error to this error.

Source§

impl ToContextResult for Value

Sets a dynamically typed Value to the context result.

Source§

impl ToContextResult for Blob

Source§

impl<'a> ToContextResult for &'a ValueRef

Sets the context result to the contained value.

Source§

impl<'a> ToContextResult for &'a mut ValueRef

Sets the context result to the contained value.

Source§

impl<T: 'static + ?Sized> ToContextResult for UnsafePtr<T>

Sets an arbitrary pointer to the context result.

Source§

impl<T: 'static> ToContextResult for PassedRef<T>

Sets the context result to NULL with this value as an associated pointer.

Source§

impl<T: ToContextResult> ToContextResult for Result<T>

Sets either the context result or error, depending on the result.