pub trait MarkerColumnCountValid<Row: ?Sized, Inferred, Actual, Proof = ()> { }Expand description
The decode target Actual matches what the query selects.
.all(), .get() and .rows() require this bound. Inferred is the
query’s inferred row type and Actual the type the caller decodes into.
- Explicit columns: each column of
Actualmust have the selected column’s type, and must beOptionwhen an outer join or a nullable operand can make it NULL. - Joined
SELECT *:Actualmust keep the inferred shape (seeJoinedStarRow). - Raw SQL:
Actualmust equalInferred. - Single-table
SELECT *andFromRowselections are not checked here.
Proof is the same witness the terminal method infers for
MarkerScopeValidFor, so outer-join nullability found while checking
scope also decides which decoded columns must be Option.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<Row: ?Sized, Cols, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for SelectCols<Cols>where
Cols: SelectedColumnList,
Actual: RowColumnList<Row>,
<Cols as SelectedColumnList>::Columns: TypeListCompatible<Row, <Actual as RowColumnList<Row>>::Columns>,
impl<Row: ?Sized, Cols, Scope, Used, Inferred, Actual, UsedProof, ColsProof> MarkerColumnCountValid<Row, Inferred, Actual, (UsedProof, ColsProof)> for Scoped<SelectCols<Cols>, Scope, Used>where
Cols: SelectedExpressionList,
Cols::Expressions: ProjectionIn<Scope, ColsProof>,
Actual: RowColumnList<Row>,
<Cols::Expressions as ProjectionIn<Scope, ColsProof>>::Columns: TypeListCompatible<Row, <Actual as RowColumnList<Row>>::Columns>,
impl<Row: ?Sized, First, Second, Rest, Used, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for Scoped<SelectStar, Cons<First, Cons<Second, Rest>>, Used>where
Inferred: JoinedStarRow<Actual>,
Joined SELECT *: the decode target must keep the inferred row shape, with
Option on every source that an outer join can leave NULL.
impl<Row: ?Sized, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for SelectExprwhere
Inferred: SameType<Actual>,
impl<Row: ?Sized, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for SelectStar
impl<Row: ?Sized, R, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for SelectAs<R>
impl<Row: ?Sized, R, Scope, Used, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for Scoped<SelectAs<R>, Scope, Used>
FromRow selectors are checked by MarkerScopeValidFor.
impl<Row: ?Sized, Scope, Used, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for Scoped<SelectExpr, Scope, Used>where
Inferred: SameType<Actual>,
impl<Row: ?Sized, Table, Used, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for Scoped<SelectStar, Cons<Table, Nil>, Used>
Single-source SELECT *: the table model may be decoded into any row type.