Skip to main content

ColumnValue

Trait ColumnValue 

Source
pub trait ColumnValue {
    type Rust;

    const TYPE: ColumnType;

    // Required method
    fn from_value(value: Value) -> Option<Self::Rust>;
}
Expand description

The Rust value a column whose SQL type is Self is set to: the SQL type’s Rust type, or an Option of it for a nullable column.

Required Associated Constants§

Source

const TYPE: ColumnType

What the column takes, for the compile-time check that a domain field’s value fits it: ColumnType::not_null for a NOT NULL SQL type.

Required Associated Types§

Source

type Rust

The Rust type.

Required Methods§

Source

fn from_value(value: Value) -> Option<Self::Rust>

The value as that type; None if it does not fit (another type, or a NULL for a NOT NULL column).

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 ColumnValue for BigInt

Source§

impl ColumnValue for Bool

Source§

impl ColumnValue for Date

Source§

impl ColumnValue for Datetime

Source§

impl ColumnValue for Double

Source§

impl ColumnValue for Float

Source§

impl ColumnValue for Integer

Source§

impl ColumnValue for SmallInt

Source§

impl ColumnValue for Text

Source§

impl ColumnValue for Time

Source§

impl ColumnValue for Timestamp

Source§

impl ColumnValue for Timestamptz

Source§

impl ColumnValue for TimestamptzSqlite

Source§

impl<ST: ValueSqlType> ColumnValue for Nullable<ST>

Implementors§