Trait FromExpr

Source
pub trait FromExpr<'transaction, S, From>: 'transaction + Sized {
    // Required method
    fn from_expr<'columns>(
        col: impl IntoExpr<'columns, S, Typ = From>,
    ) -> Select<'columns, 'transaction, S, Self>;
}
Expand description

Trait for values that can be retrieved from the database using one expression.

This is most likely the trait that you want to implement for your custom datatype. Together with the crate::IntoExpr trait.

Note that this trait can also be implemented using the rust_query::FromExpr derive macro.

Required Methods§

Source

fn from_expr<'columns>( col: impl IntoExpr<'columns, S, Typ = From>, ) -> Select<'columns, 'transaction, S, Self>

How to turn a column reference into a Select.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'transaction, S> FromExpr<'transaction, S, bool> for bool

Source§

fn from_expr<'columns>( col: impl IntoExpr<'columns, S, Typ = bool>, ) -> Select<'columns, 'transaction, S, Self>

Source§

impl<'transaction, S> FromExpr<'transaction, S, f64> for f64

Source§

fn from_expr<'columns>( col: impl IntoExpr<'columns, S, Typ = f64>, ) -> Select<'columns, 'transaction, S, Self>

Source§

impl<'transaction, S> FromExpr<'transaction, S, i64> for i64

Source§

fn from_expr<'columns>( col: impl IntoExpr<'columns, S, Typ = i64>, ) -> Select<'columns, 'transaction, S, Self>

Source§

impl<'transaction, S> FromExpr<'transaction, S, String> for String

Source§

fn from_expr<'columns>( col: impl IntoExpr<'columns, S, Typ = String>, ) -> Select<'columns, 'transaction, S, Self>

Source§

impl<'transaction, S> FromExpr<'transaction, S, Vec<u8>> for Vec<u8>

Source§

fn from_expr<'columns>( col: impl IntoExpr<'columns, S, Typ = Vec<u8>>, ) -> Select<'columns, 'transaction, S, Self>

Source§

impl<'transaction, S, From> FromExpr<'transaction, S, From> for ()

Source§

fn from_expr<'columns>( _col: impl IntoExpr<'columns, S, Typ = From>, ) -> Select<'columns, 'transaction, S, Self>

Source§

impl<'transaction, S, T, From: MyTyp> FromExpr<'transaction, S, Option<From>> for Option<T>
where T: FromExpr<'transaction, S, From>,

Source§

fn from_expr<'columns>( col: impl IntoExpr<'columns, S, Typ = Option<From>>, ) -> Select<'columns, 'transaction, S, Self>

Implementors§

Source§

impl<'transaction, T: Table> FromExpr<'transaction, <T as Table>::Schema, T> for TableRow<'transaction, T>