Struct sqlite_loadable::api::Value

source ·
pub struct Value { /* private fields */ }
Expand description

Ergonomic wrapper around a raw sqlite3_value. It is the caller’s reponsibility to ensure that a given pointer points to a valid sqlite3_value object. There seems to be a 5-10% perf cost when using Value vs calling functions on raw pointers

Implementations§

Create a Value struct from a borrowed sqlite3_value pointer

Create a Value struct from a sqlite3_value pointer slice at the given index.

Ensure that the value’s type isn’t SQLITE_NULL - return the given error as an Err.

Ensure that the value’s type isn’t SQLITE_NULL - otherwise call the error function and return as Err.

Returns the UTF8 representation of the underlying sqlite_value. Fails if the value type is SQLITE_NULL, or if there’s a UTF8 error on the resulting string.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.