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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
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.
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.