Skip to main content

MarkerColumnCountValid

Trait MarkerColumnCountValid 

Source
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 Actual must have the selected column’s type, and must be Option when an outer join or a nullable operand can make it NULL.
  • Joined SELECT *: Actual must keep the inferred shape (see JoinedStarRow).
  • Raw SQL: Actual must equal Inferred.
  • Single-table SELECT * and FromRow selections 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§

Source§

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>,

Source§

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>,

Source§

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.

Source§

impl<Row: ?Sized, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for SelectExpr
where Inferred: SameType<Actual>,

Source§

impl<Row: ?Sized, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for SelectStar

Source§

impl<Row: ?Sized, R, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for SelectAs<R>

Source§

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.

Source§

impl<Row: ?Sized, Scope, Used, Inferred, Actual, Proof> MarkerColumnCountValid<Row, Inferred, Actual, Proof> for Scoped<SelectExpr, Scope, Used>
where Inferred: SameType<Actual>,

Source§

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.