Skip to main content

ToValue

Trait ToValue 

Source
pub trait ToValue {
    // Required methods
    fn to_value(&self) -> Value;
    fn column_type() -> ColumnType;
}
Expand description

Trait for types that can be converted to a database Value

Required Methods§

Source

fn to_value(&self) -> Value

Convert this type to a database Value

Source

fn column_type() -> ColumnType

Get the column type for this Rust type

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 ToValue for &str

Source§

impl ToValue for bool

Source§

impl ToValue for f64

Source§

impl ToValue for i32

Source§

impl ToValue for i64

Source§

impl ToValue for String

Source§

impl ToValue for Vec<u8>

Source§

impl<T: ToValue> ToValue for Option<T>

Implementors§