Skip to main content

FromSpgValue

Trait FromSpgValue 

Source
pub trait FromSpgValue: Sized {
    // Required method
    fn from_spg_value(v: &Value) -> Result<Self, &'static str>;
}
Expand description

v7.3.0 — per-column decoder used by spg_row!. Surface covers every numeric / text / bytes / bool variant in Value, plus Option<T> for nullable columns.

Required Methods§

Source

fn from_spg_value(v: &Value) -> Result<Self, &'static str>

Decode one cell into Self. The returned &'static str is a short diagnostic for type mismatches (e.g. "expected integer, got TEXT"); callers wrap it into their own error type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FromSpgValue for String

Source§

fn from_spg_value(v: &Value) -> Result<Self, &'static str>

Source§

impl FromSpgValue for Vec<f32>

Source§

fn from_spg_value(v: &Value) -> Result<Self, &'static str>

Source§

impl FromSpgValue for bool

Source§

fn from_spg_value(v: &Value) -> Result<Self, &'static str>

Source§

impl FromSpgValue for f32

Source§

fn from_spg_value(v: &Value) -> Result<Self, &'static str>

Source§

impl FromSpgValue for f64

Source§

fn from_spg_value(v: &Value) -> Result<Self, &'static str>

Source§

impl FromSpgValue for i16

Source§

fn from_spg_value(v: &Value) -> Result<Self, &'static str>

Source§

impl FromSpgValue for i32

Source§

fn from_spg_value(v: &Value) -> Result<Self, &'static str>

Source§

impl FromSpgValue for i64

Source§

fn from_spg_value(v: &Value) -> Result<Self, &'static str>

Source§

impl<T: FromSpgValue> FromSpgValue for Option<T>

Source§

fn from_spg_value(v: &Value) -> Result<Self, &'static str>

Implementors§