pub trait FromValue: Sized {
const TYPE_NAME: &'static str;
// Required method
fn from_value(value: Value, column: &str) -> Result<Self>;
}Expand description
Types that can be read out of a result column.
Decoding is lenient in the way SQLite users expect: integers decode into
booleans (0 / 1), reals accept integers, text parses into dates, UUIDs
and JSON, and blobs or text decode into UUIDs. Option<T> maps NULL to
None; any other type rejects NULL.
Required Associated Constants§
Required Methods§
Sourcefn from_value(value: Value, column: &str) -> Result<Self>
fn from_value(value: Value, column: &str) -> Result<Self>
Decodes a value; column is only used for error messages.
§Errors
Returns Error::Decode when the value’s storage class or content
cannot be converted to Self.
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 FromValue for DateTime<FixedOffset>
Available on crate feature with-chrono only.
impl FromValue for DateTime<FixedOffset>
Available on crate feature
with-chrono only.Source§impl FromValue for NaiveDateTime
Available on crate feature with-chrono only.
impl FromValue for NaiveDateTime
Available on crate feature
with-chrono only.