Skip to main content

ToColumn

Trait ToColumn 

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

Lowers a field value to a sea_query::Value for binding.

Impl’d explicitly (not via a blanket impl<T: Into<Value>>) for each supported type and its Option. The blanket form is tempting but is a coherence trap: it claims every T, so a downstream crate could never add ToColumn for its own enum/newtype. Keeping these concrete leaves the trait open — a custom column type adds one ToColumn impl (see impl_string_column! for the string-enum case).

Required Methods§

Source

fn to_value(&self) -> Value

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ToColumn for DateTime<Utc>

Source§

fn to_value(&self) -> Value

Source§

impl ToColumn for NaiveDate

Source§

fn to_value(&self) -> Value

Source§

impl ToColumn for String

Source§

fn to_value(&self) -> Value

Source§

impl ToColumn for Vec<u8>

Source§

fn to_value(&self) -> Value

Source§

impl ToColumn for bool

Source§

fn to_value(&self) -> Value

Source§

impl ToColumn for f64

Source§

fn to_value(&self) -> Value

Source§

impl ToColumn for i32

Source§

fn to_value(&self) -> Value

Source§

impl ToColumn for i64

Source§

fn to_value(&self) -> Value

Source§

impl ToColumn for u32

Source§

fn to_value(&self) -> Value

Source§

impl ToColumn for u64

Source§

fn to_value(&self) -> Value

Source§

impl<T: ToColumn + SqlType> ToColumn for Option<T>

Blanket nullability for binding, mirroring the FromColumn side: None binds as a typed NULL chosen from the inner type’s ColumnType (some drivers need the type even for NULL), Some delegates. Coherent in-crate, so custom types are nullable without a downstream Option impl.

Source§

fn to_value(&self) -> Value

Implementors§