Skip to main content

FromColumn

Trait FromColumn 

Source
pub trait FromColumn: Sized {
    // Required method
    fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>;
}
Expand description

Trait for types that can be extracted from a column.

Required Methods§

Source

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Extract value from a row 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 FromColumn for DateTime<Utc>

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for Decimal

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for NaiveDate

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for NaiveDateTime

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for NaiveTime

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for String

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for Uuid

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for Value

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for Vec<f32>

Dense pgvector columns decode into Vec<f32>. The schema-generated client uses this for Vector(N) and HalfVector(N) scalar fields. The underlying driver implements RowRef::get_vector — drivers that don’t have a pgvector binding will surface an unsupported error at query time rather than at compile time.

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for Vec<u8>

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for bool

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for f64

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for i32

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl FromColumn for i64

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Source§

impl<T: FromColumn> FromColumn for Option<T>

Blanket impl so every FromColumn type also satisfies FromColumn through Option<T> without each consumer needing a hand-written nullable wrapper — schema-generated enum types can’t write their own impl FromColumn for Option<MyEnum> because of the orphan rule (both Option and FromColumn are foreign from the consumer crate’s perspective).

Uses RowRef::is_null to short-circuit null rows to None; the non-null path delegates to T::from_column. Drivers that had a faster native Option<primitive> path previously now go through this blanket — the extra is_null round-trip is a small per-column cost in exchange for the orphan-rule unblock.

Source§

fn from_column(row: &impl RowRef, column: &str) -> Result<Self, RowError>

Implementors§