Skip to main content

ToValue

Trait ToValue 

Source
pub trait ToValue {
    // Required method
    fn to_value(self) -> Value;
}
Expand description

Conversion into a bound argument.

Required Methods§

Source

fn to_value(self) -> Value

Consume self and produce the argument to bind.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ToValue for &String

Source§

impl ToValue for &[u8]

Source§

impl ToValue for &str

Source§

impl ToValue for ()

The unit type binds as NULL, so push_arg(()) needs no ceremony.

Source§

impl ToValue for Cow<'_, str>

Source§

impl ToValue for Decimal

Source§

impl ToValue for NaiveDate

Source§

impl ToValue for NaiveDateTime

Source§

impl ToValue for NaiveTime

Source§

impl ToValue for String

Source§

impl ToValue for Uuid

Source§

impl ToValue for Value

Source§

impl ToValue for Vec<u8>

Source§

impl ToValue for bool

Source§

impl ToValue for f32

Source§

impl ToValue for f64

Source§

impl ToValue for i8

Source§

impl ToValue for i16

Source§

impl ToValue for i32

Source§

impl ToValue for i64

Source§

impl ToValue for isize

Source§

impl ToValue for u8

Source§

impl ToValue for u16

Source§

impl ToValue for u32

Source§

impl ToValue for u64

Source§

impl ToValue for usize

Source§

impl<T: CustomValue> ToValue for Arc<T>

Source§

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

None binds as SQL NULL.

Source§

impl<Tz: TimeZone> ToValue for DateTime<Tz>

Any zoned datetime — Utc, FixedOffset, Local — binds as the instant it names, normalised to UTC. The offset is dropped because no target database stores one; an application that needs the original offset keeps it in its own column.

Implementors§

Source§

impl ToValue for keelson_core::Value