Skip to main content

Table

Trait Table 

Source
pub trait Table<'scope> {
    type Nullify: Table<'scope>;
    type Result;

    // Required methods
    fn visit(&self, f: &mut impl FnMut(&ErasedExpr));
    fn visit_mut(&mut self, f: &mut impl FnMut(&mut ErasedExpr));
    fn nullify(self) -> Self::Nullify;
}
Expand description

A trait that represents a database result row.

If you implement Table on your type, you must also implement ForLifetimeTable.

Required Associated Types§

Source

type Nullify: Table<'scope>

Source

type Result

Required Methods§

Source

fn visit(&self, f: &mut impl FnMut(&ErasedExpr))

Visit each expr in the table.

The order and number of expressions visited must always remain the same, across: Table::visit, Table::visit_mut, and all methods of MapTable.

Source

fn visit_mut(&mut self, f: &mut impl FnMut(&mut ErasedExpr))

Visit each expr in the table, with a mutable reference.

The order and number of expressions visited must always remain the same, across: Table::visit, Table::visit_mut, and all methods of MapTable.

Source

fn nullify(self) -> Self::Nullify

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<'scope, A: Table<'scope>> Table<'scope> for (A,)

Source§

type Nullify = (<A as Table<'scope>>::Nullify,)

Source§

type Result = (<A as Table<'scope>>::Result,)

Source§

fn visit(&self, f: &mut impl FnMut(&ErasedExpr))

Source§

fn visit_mut(&mut self, f: &mut impl FnMut(&mut ErasedExpr))

Source§

fn nullify(self) -> Self::Nullify

Source§

impl<'scope, A: Table<'scope>, B: Table<'scope>> Table<'scope> for (A, B)

Source§

type Nullify = (<A as Table<'scope>>::Nullify, <B as Table<'scope>>::Nullify)

Source§

type Result = (<A as Table<'scope>>::Result, <B as Table<'scope>>::Result)

Source§

fn visit(&self, f: &mut impl FnMut(&ErasedExpr))

Source§

fn visit_mut(&mut self, f: &mut impl FnMut(&mut ErasedExpr))

Source§

fn nullify(self) -> Self::Nullify

Source§

impl<'scope, A: Table<'scope>, B: Table<'scope>, C: Table<'scope>> Table<'scope> for (A, B, C)

Source§

type Nullify = (<A as Table<'scope>>::Nullify, <B as Table<'scope>>::Nullify, <C as Table<'scope>>::Nullify)

Source§

type Result = (<A as Table<'scope>>::Result, <B as Table<'scope>>::Result, <C as Table<'scope>>::Result)

Source§

fn visit(&self, f: &mut impl FnMut(&ErasedExpr))

Source§

fn visit_mut(&mut self, f: &mut impl FnMut(&mut ErasedExpr))

Source§

fn nullify(self) -> Self::Nullify

Implementors§

Source§

impl<'scope, A> Table<'scope> for One<'scope, ExprMode, A>
where <Self as TableHKT>::Of<ExprNullifiedMode>: Table<'scope>, A: Value,

Source§

impl<'scope, A> Table<'scope> for One<'scope, ExprNullifiedMode, A>
where A: Value,

Source§

impl<'scope, A, B> Table<'scope> for Two<'scope, ExprMode, A, B>
where <Self as TableHKT>::Of<ExprNullifiedMode>: Table<'scope>, A: Value, B: Value,

Source§

type Nullify = <Two<'scope, ExprMode, A, B> as TableHKT>::Of<ExprNullifiedMode>

Source§

type Result = <Two<'scope, ExprMode, A, B> as TableHKT>::Of<ValueMode>

Source§

impl<'scope, A, B> Table<'scope> for Two<'scope, ExprNullifiedMode, A, B>
where A: Value, B: Value,

Source§

impl<'scope, A, B, C> Table<'scope> for Three<'scope, ExprMode, A, B, C>
where <Self as TableHKT>::Of<ExprNullifiedMode>: Table<'scope>, A: Value, B: Value, C: Value,

Source§

type Nullify = <Three<'scope, ExprMode, A, B, C> as TableHKT>::Of<ExprNullifiedMode>

Source§

type Result = <Three<'scope, ExprMode, A, B, C> as TableHKT>::Of<ValueMode>

Source§

impl<'scope, A, B, C> Table<'scope> for Three<'scope, ExprNullifiedMode, A, B, C>
where A: Value, B: Value, C: Value,

Source§

impl<'scope, T> Table<'scope> for Expr<'scope, T>

Source§

type Nullify = Expr<'scope, Option<T>>

Source§

type Result = T

Source§

impl<'scope, T> Table<'scope> for TableUsingMapper<T>
where T: Table<'scope> + MapTable<'scope> + TableHKT<Mode = ExprMode>, T::Of<ExprNullifiedMode>: Table<'scope>,

Source§

impl<'scope, T> Table<'scope> for TableUsingMapperNullified<T>
where T: Table<'scope> + MapTable<'scope> + TableHKT<Mode = ExprNullifiedMode>,

Source§

impl<'scope, T: Table<'scope>> Table<'scope> for MaybeTable<'scope, T>

Source§

type Nullify = MaybeTable<'scope, T>

Source§

type Result = Option<<T as Table<'scope>>::Result>