Trait IntoSelect

Source
pub trait IntoSelect<'columns, 'transaction, S>: Sized {
    type Out: 'transaction;

    // Required method
    fn into_select(self) -> Select<'columns, 'transaction, S, Self::Out>;
}
Expand description

This trait is implemented by everything that can be retrieved from the database.

Instead of implementing it yourself you probably want to use the rust_query::Select macro.

Required Associated Types§

Source

type Out: 'transaction

The type that results from executing the Select.

Required Methods§

Source

fn into_select(self) -> Select<'columns, 'transaction, S, Self::Out>

This method is what tells rust-query how to turn the value into a Select.

The only way to implement this method is by constructing a different value that implements IntoSelect and then calling the IntoSelect::into_select method on that other value.

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<'columns, 'transaction, S> IntoSelect<'columns, 'transaction, S> for ()

Source§

type Out = ()

Source§

fn into_select(self) -> Select<'columns, 'transaction, S, Self::Out>

Source§

impl<'columns, 'transaction, S, A, B> IntoSelect<'columns, 'transaction, S> for (A, B)
where A: IntoSelect<'columns, 'transaction, S>, B: IntoSelect<'columns, 'transaction, S>,

Source§

type Out = (<A as IntoSelect<'columns, 'transaction, S>>::Out, <B as IntoSelect<'columns, 'transaction, S>>::Out)

Source§

fn into_select(self) -> Select<'columns, 'transaction, S, Self::Out>

Source§

impl<'columns, 'transaction, S, T> IntoSelect<'columns, 'transaction, S> for &T
where T: IntoSelect<'columns, 'transaction, S> + Clone,

Source§

type Out = <T as IntoSelect<'columns, 'transaction, S>>::Out

Source§

fn into_select(self) -> Select<'columns, 'transaction, S, Self::Out>

Implementors§

Source§

impl<'columns, 'transaction, S, Out: 'transaction> IntoSelect<'columns, 'transaction, S> for Select<'columns, 'transaction, S, Out>

Source§

type Out = Out

Source§

impl<'columns, 'transaction, S, T> IntoSelect<'columns, 'transaction, S> for Expr<'columns, S, T>
where T: MyTyp,

Source§

type Out = <T as MyTyp>::Out<'transaction>