Skip to main content

FromValue

Trait FromValue 

Source
pub trait FromValue: Sized {
    // Required method
    fn from_value(v: &Value) -> Result<Self>;
}
Expand description

Conversion from SQLRite’s internal Value enum into a typed Rust value. Implementations cover the common built-ins — i64, f64, String, bool, and Option<T> for nullable columns. Extend on demand.

Required Methods§

Source

fn from_value(v: &Value) -> Result<Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromValue for bool

Source§

impl FromValue for f64

Source§

impl FromValue for i64

Source§

impl FromValue for String

Source§

impl<T: FromValue> FromValue for Option<T>

Nullable columns: Option<T> maps NULL → None and everything else through the inner type’s FromValue impl.

Implementors§

Source§

impl FromValue for Value

Identity impl so row.get::<_, Value>(0) works when you want untyped access.