pub trait PgCollectionStorage<VF> {
type Sequence: ComplexComparison<Postgres>;
type Set: ComplexComparison<Postgres>;
}postgres and sqlx only.Expand description
Which storage strategy Postgres keeps a collection of THIS element type in — the half of
CollectionStorage that the one dialect with two usable strategies cannot answer from the
dialect alone.
Public, and for the reason Carrier is: this is the surface a downstream
element type joins the collection vocabulary through on Postgres, and a type with a row here
needs nothing else from this crate to be filtered on as a list or as a set.
§Why the dialect cannot answer alone
Both column-stored kinds’ Postgres lowerings are bounded V: PgHasArrayType — the sqlx row
naming the array type OID an element lives in — and a great many element types have no such row.
This crate’s own BeU64 is one: it binds fine as a scalar and sqlx names no
array type for a blob carrier. A dialect-keyed answer sends every one of them to a column-stored
kind and the bound then fails at the LOWERING, naming a sqlx trait, with no fallback and no way
to ask for one.
So the refusal moves here, and moving it is half of what this trait buys: a missing row is
E0277 at the crossing, naming the row a reader can go and write, where it used to be E0599
on apply naming PgHasArrayType. That message is pinned as exact text —
tests/pg_collection_strategy/ — because it is the deliverable rather than a side effect.
§Why the choice is declared rather than deduced
The two impls that would deduce it —
impl<V: PgHasArrayType> CollectionStorage<V> for Postgres { … }
impl<V> CollectionStorage<V> for Postgres { … }— are E0119, and both routes out of that are unstable: V: !PgHasArrayType is a negative bound
and the alternative is specialization. So the choice is a ROW, and the row is keyed on the
element type because that is what it is a fact about.
A blanket impl<V: PgHasArrayType> PgCollectionStorage for V is refused for the same reason one
level down: it would make the array case automatic and then leave a type WITHOUT an array type
unable to be given a row at all, since a specific impl would overlap the blanket and rustc will
not prove the negative for a foreign trait. That closes the surface this trait exists to open.
Per-type rows are what Carrier already asks for, and a downstream pays the
same one-line price here that it pays there.
§A row that has the array and declines it is legal, and that is the second thing this buys
The strategy is not a fallback for types the array cannot hold. An element type with a perfectly
good PgHasArrayType may name the edge table anyway — a list long enough that an unindexed @>
over it is the wrong plan, or an index shape an array cannot give — and it costs one row. That
was unspellable while the dialect answered.
§The two answers are independent, which the shape parameter could not make them
A row states its sequence strategy and its set strategy separately, so an element may keep an
ordered column in an array and send its unordered one to an edge table — where an index on
(key…, value) answers containment with a seek and an array cannot. Every row this crate ships
states the same strategy twice, and that is a fact about these elements rather than a rule.
§The rows this crate ships
One per element type in the Postgres Carrier table, and the rule that picks
between the two is a single question: does sqlx’s array type for this element match the column
its carrier row binds into? Where it does, the array; where it does not — or where there is no
array type at all — the edge table. See the two lists beside the rows themselves.
§The lowering promise travels ONE level further, for the reason it reached
CollectionStorage at all
Postgres’s row states whatever this one states — its two answers ARE this one’s — so a promise
that stopped at the dialect would have to be proved from V: PgCollectionStorage alone, where
the types are opaque. Restating it here is what makes it provable, and it lands where the choice
is actually made: an element type picking a strategy is picking a comparison, and a strategy
whose comparison cannot be lowered is not one.
§VF travels here too, for the reason it reached CollectionStorage
A strategy names a comparison and a collection comparison holds the ELEMENT’s, so a row states its answer over both. A row is still one line per element type, and it is where the element’s own crossing is finally written — at a named dialect, which is the only place a projection through it resolves.
§The refusal is WRITTEN, and the list beside it is made to stop moving
Unimplemented, rustc names the eight types with a row that sort first and says and N others.
Which eight was a function of the FEATURE SET — the wrapper’s rows are jiff + time, so their
presence displaced another entry — and the fixture that pins this refusal as exact text was
therefore unassertable in any build without both, which is what kept a dialect-only build red.
The wrapper’s two rows carry do_not_recommend and no other row
does: they were the only entries that could come and go, so suppressing exactly them settles the
text and leaves the list itself — which is a real suggestion to whoever reads it.
The sentence above is what a reader acts on, and it is written rather than inferred from that
list, which names types and not the thing to do. The second note is there because this bound has
a second way to fail that the first does not describe: Self may HAVE a row while {VF} has no
ToDatabaseComparison into it. Which message a reader
sees then depends on what they wrote — a failing PROJECTION is reported at that crossing directly
and never reaches this text, while a caller who named this bound in a where-clause gets this one,
and there the note is the only thing distinguishing the two missing pieces.
Required Associated Types§
Sourcetype Sequence: ComplexComparison<Postgres>
type Sequence: ComplexComparison<Postgres>
The comparison a ListFilter over a sequence of Self crosses into on Postgres.
Sourcetype Set: ComplexComparison<Postgres>
type Set: ComplexComparison<Postgres>
The comparison a SetFilter over a set of Self crosses into on Postgres.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'a, VF: ToDatabaseComparison<&'a Date, Postgres>> PgCollectionStorage<VF> for &'a Date
impl<'a, VF: ToDatabaseComparison<&'a Date, Postgres>> PgCollectionStorage<VF> for &'a Date
type Sequence = SqlListComparison<&'a Date, <VF as ToDatabaseComparison<&'a Date, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a Date, <VF as ToDatabaseComparison<&'a Date, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a Duration, Postgres>> PgCollectionStorage<VF> for &'a Duration
impl<'a, VF: ToDatabaseComparison<&'a Duration, Postgres>> PgCollectionStorage<VF> for &'a Duration
type Sequence = SqlListComparison<&'a Duration, <VF as ToDatabaseComparison<&'a Duration, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a Duration, <VF as ToDatabaseComparison<&'a Duration, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a OffsetDateTime, Postgres>> PgCollectionStorage<VF> for &'a OffsetDateTime
impl<'a, VF: ToDatabaseComparison<&'a OffsetDateTime, Postgres>> PgCollectionStorage<VF> for &'a OffsetDateTime
type Sequence = SqlListComparison<&'a OffsetDateTime, <VF as ToDatabaseComparison<&'a OffsetDateTime, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a OffsetDateTime, <VF as ToDatabaseComparison<&'a OffsetDateTime, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a PgInterval, Postgres>> PgCollectionStorage<VF> for &'a PgInterval
impl<'a, VF: ToDatabaseComparison<&'a PgInterval, Postgres>> PgCollectionStorage<VF> for &'a PgInterval
type Sequence = SqlListComparison<&'a PgInterval, <VF as ToDatabaseComparison<&'a PgInterval, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a PgInterval, <VF as ToDatabaseComparison<&'a PgInterval, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a PrimitiveDateTime, Postgres>> PgCollectionStorage<VF> for &'a PrimitiveDateTime
impl<'a, VF: ToDatabaseComparison<&'a PrimitiveDateTime, Postgres>> PgCollectionStorage<VF> for &'a PrimitiveDateTime
type Sequence = SqlListComparison<&'a PlainDateTime, <VF as ToDatabaseComparison<&'a PlainDateTime, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a PlainDateTime, <VF as ToDatabaseComparison<&'a PlainDateTime, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a String, Postgres>> PgCollectionStorage<VF> for &'a String
impl<'a, VF: ToDatabaseComparison<&'a String, Postgres>> PgCollectionStorage<VF> for &'a String
type Sequence = SqlListComparison<&'a String, <VF as ToDatabaseComparison<&'a String, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a String, <VF as ToDatabaseComparison<&'a String, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a Time, Postgres>> PgCollectionStorage<VF> for &'a Time
impl<'a, VF: ToDatabaseComparison<&'a Time, Postgres>> PgCollectionStorage<VF> for &'a Time
type Sequence = SqlListComparison<&'a Time, <VF as ToDatabaseComparison<&'a Time, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a Time, <VF as ToDatabaseComparison<&'a Time, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a Vec<u8>, Postgres>> PgCollectionStorage<VF> for &'a Vec<u8>
impl<'a, VF: ToDatabaseComparison<&'a Vec<u8>, Postgres>> PgCollectionStorage<VF> for &'a Vec<u8>
type Sequence = SqlListComparison<&'a Vec<u8>, <VF as ToDatabaseComparison<&'a Vec<u8>, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a Vec<u8>, <VF as ToDatabaseComparison<&'a Vec<u8>, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a bool, Postgres>> PgCollectionStorage<VF> for &'a bool
impl<'a, VF: ToDatabaseComparison<&'a bool, Postgres>> PgCollectionStorage<VF> for &'a bool
type Sequence = SqlListComparison<&'a bool, <VF as ToDatabaseComparison<&'a bool, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a bool, <VF as ToDatabaseComparison<&'a bool, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a f32, Postgres>> PgCollectionStorage<VF> for &'a f32
impl<'a, VF: ToDatabaseComparison<&'a f32, Postgres>> PgCollectionStorage<VF> for &'a f32
type Sequence = SqlListComparison<&'a f32, <VF as ToDatabaseComparison<&'a f32, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a f32, <VF as ToDatabaseComparison<&'a f32, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a f64, Postgres>> PgCollectionStorage<VF> for &'a f64
impl<'a, VF: ToDatabaseComparison<&'a f64, Postgres>> PgCollectionStorage<VF> for &'a f64
type Sequence = SqlListComparison<&'a f64, <VF as ToDatabaseComparison<&'a f64, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a f64, <VF as ToDatabaseComparison<&'a f64, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a i8, Postgres>> PgCollectionStorage<VF> for &'a i8
impl<'a, VF: ToDatabaseComparison<&'a i8, Postgres>> PgCollectionStorage<VF> for &'a i8
type Sequence = SqlEdgeComparison<&'a i8, <VF as ToDatabaseComparison<&'a i8, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<&'a i8, <VF as ToDatabaseComparison<&'a i8, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a i16, Postgres>> PgCollectionStorage<VF> for &'a i16
impl<'a, VF: ToDatabaseComparison<&'a i16, Postgres>> PgCollectionStorage<VF> for &'a i16
type Sequence = SqlListComparison<&'a i16, <VF as ToDatabaseComparison<&'a i16, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a i16, <VF as ToDatabaseComparison<&'a i16, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a i32, Postgres>> PgCollectionStorage<VF> for &'a i32
impl<'a, VF: ToDatabaseComparison<&'a i32, Postgres>> PgCollectionStorage<VF> for &'a i32
type Sequence = SqlListComparison<&'a i32, <VF as ToDatabaseComparison<&'a i32, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a i32, <VF as ToDatabaseComparison<&'a i32, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a i64, Postgres>> PgCollectionStorage<VF> for &'a i64
impl<'a, VF: ToDatabaseComparison<&'a i64, Postgres>> PgCollectionStorage<VF> for &'a i64
type Sequence = SqlListComparison<&'a i64, <VF as ToDatabaseComparison<&'a i64, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<&'a i64, <VF as ToDatabaseComparison<&'a i64, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a u8, Postgres>> PgCollectionStorage<VF> for &'a u8
impl<'a, VF: ToDatabaseComparison<&'a u8, Postgres>> PgCollectionStorage<VF> for &'a u8
type Sequence = SqlEdgeComparison<&'a u8, <VF as ToDatabaseComparison<&'a u8, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<&'a u8, <VF as ToDatabaseComparison<&'a u8, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a u16, Postgres>> PgCollectionStorage<VF> for &'a u16
impl<'a, VF: ToDatabaseComparison<&'a u16, Postgres>> PgCollectionStorage<VF> for &'a u16
type Sequence = SqlEdgeComparison<&'a u16, <VF as ToDatabaseComparison<&'a u16, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<&'a u16, <VF as ToDatabaseComparison<&'a u16, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a u32, Postgres>> PgCollectionStorage<VF> for &'a u32
impl<'a, VF: ToDatabaseComparison<&'a u32, Postgres>> PgCollectionStorage<VF> for &'a u32
type Sequence = SqlEdgeComparison<&'a u32, <VF as ToDatabaseComparison<&'a u32, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<&'a u32, <VF as ToDatabaseComparison<&'a u32, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<Date, Postgres>> PgCollectionStorage<VF> for Date
impl<VF: ToDatabaseComparison<Date, Postgres>> PgCollectionStorage<VF> for Date
type Sequence = SqlListComparison<Date, <VF as ToDatabaseComparison<Date, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<Date, <VF as ToDatabaseComparison<Date, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<Duration, Postgres>> PgCollectionStorage<VF> for Duration
impl<VF: ToDatabaseComparison<Duration, Postgres>> PgCollectionStorage<VF> for Duration
type Sequence = SqlListComparison<Duration, <VF as ToDatabaseComparison<Duration, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<Duration, <VF as ToDatabaseComparison<Duration, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<OffsetDateTime, Postgres>> PgCollectionStorage<VF> for OffsetDateTime
impl<VF: ToDatabaseComparison<OffsetDateTime, Postgres>> PgCollectionStorage<VF> for OffsetDateTime
type Sequence = SqlListComparison<OffsetDateTime, <VF as ToDatabaseComparison<OffsetDateTime, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<OffsetDateTime, <VF as ToDatabaseComparison<OffsetDateTime, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<PgInterval, Postgres>> PgCollectionStorage<VF> for PgInterval
impl<VF: ToDatabaseComparison<PgInterval, Postgres>> PgCollectionStorage<VF> for PgInterval
type Sequence = SqlListComparison<PgInterval, <VF as ToDatabaseComparison<PgInterval, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<PgInterval, <VF as ToDatabaseComparison<PgInterval, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<PrimitiveDateTime, Postgres>> PgCollectionStorage<VF> for PrimitiveDateTime
impl<VF: ToDatabaseComparison<PrimitiveDateTime, Postgres>> PgCollectionStorage<VF> for PrimitiveDateTime
type Sequence = SqlListComparison<PlainDateTime, <VF as ToDatabaseComparison<PlainDateTime, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<PlainDateTime, <VF as ToDatabaseComparison<PlainDateTime, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<String, Postgres>> PgCollectionStorage<VF> for String
impl<VF: ToDatabaseComparison<String, Postgres>> PgCollectionStorage<VF> for String
type Sequence = SqlListComparison<String, <VF as ToDatabaseComparison<String, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<String, <VF as ToDatabaseComparison<String, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<Time, Postgres>> PgCollectionStorage<VF> for Time
impl<VF: ToDatabaseComparison<Time, Postgres>> PgCollectionStorage<VF> for Time
type Sequence = SqlListComparison<Time, <VF as ToDatabaseComparison<Time, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<Time, <VF as ToDatabaseComparison<Time, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<Vec<u8>, Postgres>> PgCollectionStorage<VF> for Vec<u8>
impl<VF: ToDatabaseComparison<Vec<u8>, Postgres>> PgCollectionStorage<VF> for Vec<u8>
type Sequence = SqlListComparison<Vec<u8>, <VF as ToDatabaseComparison<Vec<u8>, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<Vec<u8>, <VF as ToDatabaseComparison<Vec<u8>, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<bool, Postgres>> PgCollectionStorage<VF> for bool
impl<VF: ToDatabaseComparison<bool, Postgres>> PgCollectionStorage<VF> for bool
type Sequence = SqlListComparison<bool, <VF as ToDatabaseComparison<bool, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<bool, <VF as ToDatabaseComparison<bool, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<f32, Postgres>> PgCollectionStorage<VF> for f32
impl<VF: ToDatabaseComparison<f32, Postgres>> PgCollectionStorage<VF> for f32
type Sequence = SqlListComparison<f32, <VF as ToDatabaseComparison<f32, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<f32, <VF as ToDatabaseComparison<f32, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<f64, Postgres>> PgCollectionStorage<VF> for f64
impl<VF: ToDatabaseComparison<f64, Postgres>> PgCollectionStorage<VF> for f64
type Sequence = SqlListComparison<f64, <VF as ToDatabaseComparison<f64, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<f64, <VF as ToDatabaseComparison<f64, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<i8, Postgres>> PgCollectionStorage<VF> for i8
impl<VF: ToDatabaseComparison<i8, Postgres>> PgCollectionStorage<VF> for i8
type Sequence = SqlEdgeComparison<i8, <VF as ToDatabaseComparison<i8, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<i8, <VF as ToDatabaseComparison<i8, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<i16, Postgres>> PgCollectionStorage<VF> for i16
impl<VF: ToDatabaseComparison<i16, Postgres>> PgCollectionStorage<VF> for i16
type Sequence = SqlListComparison<i16, <VF as ToDatabaseComparison<i16, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<i16, <VF as ToDatabaseComparison<i16, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<i32, Postgres>> PgCollectionStorage<VF> for i32
impl<VF: ToDatabaseComparison<i32, Postgres>> PgCollectionStorage<VF> for i32
type Sequence = SqlListComparison<i32, <VF as ToDatabaseComparison<i32, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<i32, <VF as ToDatabaseComparison<i32, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<i64, Postgres>> PgCollectionStorage<VF> for i64
impl<VF: ToDatabaseComparison<i64, Postgres>> PgCollectionStorage<VF> for i64
type Sequence = SqlListComparison<i64, <VF as ToDatabaseComparison<i64, Postgres>>::Comparison, Postgres>
type Set = SqlSetComparison<i64, <VF as ToDatabaseComparison<i64, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<u8, Postgres>> PgCollectionStorage<VF> for u8
impl<VF: ToDatabaseComparison<u8, Postgres>> PgCollectionStorage<VF> for u8
type Sequence = SqlEdgeComparison<u8, <VF as ToDatabaseComparison<u8, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<u8, <VF as ToDatabaseComparison<u8, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<u16, Postgres>> PgCollectionStorage<VF> for u16
impl<VF: ToDatabaseComparison<u16, Postgres>> PgCollectionStorage<VF> for u16
type Sequence = SqlEdgeComparison<u16, <VF as ToDatabaseComparison<u16, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<u16, <VF as ToDatabaseComparison<u16, Postgres>>::Comparison, Postgres>
Source§impl<VF: ToDatabaseComparison<u32, Postgres>> PgCollectionStorage<VF> for u32
impl<VF: ToDatabaseComparison<u32, Postgres>> PgCollectionStorage<VF> for u32
type Sequence = SqlEdgeComparison<u32, <VF as ToDatabaseComparison<u32, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<u32, <VF as ToDatabaseComparison<u32, Postgres>>::Comparison, Postgres>
Implementors§
Source§impl<'a, S, VF> PgCollectionStorage<VF> for &'a Confidence<S>where
S: ConfidenceCarrier + Carrier<Postgres>,
VF: ToDatabaseComparison<&'a Confidence<S>, Postgres>,
impl<'a, S, VF> PgCollectionStorage<VF> for &'a Confidence<S>where
S: ConfidenceCarrier + Carrier<Postgres>,
VF: ToDatabaseComparison<&'a Confidence<S>, Postgres>,
type Sequence = SqlEdgeComparison<&'a Confidence<S>, <VF as ToDatabaseComparison<&'a Confidence<S>, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<&'a Confidence<S>, <VF as ToDatabaseComparison<&'a Confidence<S>, Postgres>>::Comparison, Postgres>
Source§impl<'a, T, VF> PgCollectionStorage<VF> for &'a Temporal<T>where
T: PgCollectionStorage<VF>,
<T as PgCollectionStorage<VF>>::Sequence: StrategyOver<&'a Temporal<T>, Comparison: ComplexComparison<Postgres>>,
<T as PgCollectionStorage<VF>>::Set: StrategyOver<&'a Temporal<T>, Comparison: ComplexComparison<Postgres>>,
Available on crate features jiff and time only.The borrowed half, as Carrier carries one. It reads the same
OWNED rows on T: what the wrapper is borrowed does not change which column T lives in.
impl<'a, T, VF> PgCollectionStorage<VF> for &'a Temporal<T>where
T: PgCollectionStorage<VF>,
<T as PgCollectionStorage<VF>>::Sequence: StrategyOver<&'a Temporal<T>, Comparison: ComplexComparison<Postgres>>,
<T as PgCollectionStorage<VF>>::Set: StrategyOver<&'a Temporal<T>, Comparison: ComplexComparison<Postgres>>,
jiff and time only.The borrowed half, as Carrier carries one. It reads the same
OWNED rows on T: what the wrapper is borrowed does not change which column T lives in.
type Sequence = <<T as PgCollectionStorage<VF>>::Sequence as StrategyOver<&'a Temporal<T>>>::Comparison
type Set = <<T as PgCollectionStorage<VF>>::Set as StrategyOver<&'a Temporal<T>>>::Comparison
Source§impl<'a, VF: ToDatabaseComparison<&'a BeI128, Postgres>> PgCollectionStorage<VF> for &'a BeI128
impl<'a, VF: ToDatabaseComparison<&'a BeI128, Postgres>> PgCollectionStorage<VF> for &'a BeI128
type Sequence = SqlEdgeComparison<&'a BeI128, <VF as ToDatabaseComparison<&'a BeI128, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<&'a BeI128, <VF as ToDatabaseComparison<&'a BeI128, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a BeU64, Postgres>> PgCollectionStorage<VF> for &'a BeU64
impl<'a, VF: ToDatabaseComparison<&'a BeU64, Postgres>> PgCollectionStorage<VF> for &'a BeU64
type Sequence = SqlEdgeComparison<&'a BeU64, <VF as ToDatabaseComparison<&'a BeU64, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<&'a BeU64, <VF as ToDatabaseComparison<&'a BeU64, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a BeU128, Postgres>> PgCollectionStorage<VF> for &'a BeU128
impl<'a, VF: ToDatabaseComparison<&'a BeU128, Postgres>> PgCollectionStorage<VF> for &'a BeU128
type Sequence = SqlEdgeComparison<&'a BeU128, <VF as ToDatabaseComparison<&'a BeU128, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<&'a BeU128, <VF as ToDatabaseComparison<&'a BeU128, Postgres>>::Comparison, Postgres>
Source§impl<'a, VF: ToDatabaseComparison<&'a Count, Postgres>> PgCollectionStorage<VF> for &'a Count
impl<'a, VF: ToDatabaseComparison<&'a Count, Postgres>> PgCollectionStorage<VF> for &'a Count
type Sequence = SqlEdgeComparison<&'a Count, <VF as ToDatabaseComparison<&'a Count, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<&'a Count, <VF as ToDatabaseComparison<&'a Count, Postgres>>::Comparison, Postgres>
Source§impl<S, VF> PgCollectionStorage<VF> for Confidence<S>
The confidence’s pair, hand-written for the reason this file’s other hand-written family is: a
free type parameter cannot cross pg_collection_storage!’s $ty:ty.
impl<S, VF> PgCollectionStorage<VF> for Confidence<S>
The confidence’s pair, hand-written for the reason this file’s other hand-written family is: a
free type parameter cannot cross pg_collection_storage!’s $ty:ty.
It is in the EDGE-TABLE family for the reason Score was — it owns its encoding rather than
sqlx’s, reaching a column through Carrier and implementing no
PgHasArrayType, so there is no array type to name. The bound carries the membership: a
confidence has this row exactly where the width it measures in has a carrier.
type Sequence = SqlEdgeComparison<Confidence<S>, <VF as ToDatabaseComparison<Confidence<S>, Postgres>>::Comparison, Postgres>
type Set = SqlEdgeSetComparison<Confidence<S>, <VF as ToDatabaseComparison<Confidence<S>, Postgres>>::Comparison, Postgres>
Source§impl<T, VF> PgCollectionStorage<VF> for Temporal<T>where
T: PgCollectionStorage<VF>,
<T as PgCollectionStorage<VF>>::Sequence: StrategyOver<Temporal<T>, Comparison: ComplexComparison<Postgres>>,
<T as PgCollectionStorage<VF>>::Set: StrategyOver<Temporal<T>, Comparison: ComplexComparison<Postgres>>,
Available on crate features jiff and time only.The jiff → time bridge’s row, hand-written for the reason to_filter! hand-writes [u8; N]’s
container family: a free type parameter cannot pass through the macro’s $ty:ty.
impl<T, VF> PgCollectionStorage<VF> for Temporal<T>where
T: PgCollectionStorage<VF>,
<T as PgCollectionStorage<VF>>::Sequence: StrategyOver<Temporal<T>, Comparison: ComplexComparison<Postgres>>,
<T as PgCollectionStorage<VF>>::Set: StrategyOver<Temporal<T>, Comparison: ComplexComparison<Postgres>>,
jiff and time only.The jiff → time bridge’s row, hand-written for the reason to_filter! hand-writes [u8; N]’s
container family: a free type parameter cannot pass through the macro’s $ty:ty.
§It reads T’s row rather than stating one of its own
The where-clause is the whole content: Temporal<T> takes whichever strategies T declared,
over the wrapper. Temporal<T> is a conversion wrapper — the column a
Vec<jiff::Timestamp> lands in IS the column a Vec<time::OffsetDateTime> lands in — so a row
that could contradict T’s would be a wrapper deciding a question about the element it wraps.
Delegating makes the two temporal crates agree by CONSTRUCTION rather than for the three storage
forms that happen to line up today.
StrategyOver is what carries the element across, and
the reason the row cannot simply repeat T’s answer: T’s row states COMPARISONS and a
comparison names its element, so what is read is Strategy<T, Postgres> where the wrapper needs
Strategy<Temporal<T>, Postgres>.
Deducing the strategy from T: PgHasArrayType + Type + Encode would look equivalent and is not,
and i8 is the measurement: it satisfies all three and still declares the edge table, because
this crate’s carrier widens it to smallint while sqlx types it "char" — so a deduced row
would send Temporal<i8> to an array of the wrong column. The refusal that keeps the strategy
DECLARED rather than deduced is the one PgCollectionStorage’s own note makes; this row
inherits it instead of re-litigating it.
§The lowering promise is kept on the RE-STATED comparisons, and names no capability
PgCollectionStorage’s two answers each promise ComplexComparison, and the projections this
row states are opaque, so each promise is carried as a bound on its own projection. What those
bounds are NOT is a capability of T: they say the strategies T declared still lower once their
element is the wrapper, and each strategy’s own impl decides what that costs — the column-stored
kinds read sqlx’s three off Temporal<T>, which delegate to T, and the edge kinds read
Carrier, which does the same. Spelling either of those here
would be this row taking a view on a strategy it has not been told yet.
§Both strategies, and the annotation is what asserts which
The projection IS the strategy, so a row that moved is E0308 here rather than a different
rendering. BeU64 is the edge case that occurs in practice: a downstream storage form may be
any type with a Carrier row — the trait naming one is
TemporalStorage, which is public and open — and this crate’s blob
carrier is one.
use ingraph::{
ListFilter, BeU64, Temporal, ToDatabaseComparison,
comparison::sql::{SqlEdgeComparison, SqlScalarComparison},
};
let _: Option<
<ListFilter<u64> as ToDatabaseComparison<Temporal<BeU64>, sqlx::Postgres>>::Comparison,
> = None::<SqlEdgeComparison<
Temporal<BeU64>,
SqlScalarComparison<Temporal<BeU64>, sqlx::Postgres>,
sqlx::Postgres,
>>;The set half reads the other column of the same row, and a Vec<jiff::Timestamp> stored through
time is where it lands on the array:
use ingraph::{
SetFilter, Temporal, ToDatabaseComparison,
comparison::sql::{SqlScalarComparison, SqlSetComparison},
};
let _: Option<
<SetFilter<jiff::Timestamp> as ToDatabaseComparison<
Temporal<time::OffsetDateTime>,
sqlx::Postgres,
>>::Comparison,
> = None::<SqlSetComparison<
Temporal<time::OffsetDateTime>,
SqlScalarComparison<Temporal<time::OffsetDateTime>, sqlx::Postgres>,
sqlx::Postgres,
>>;§The one refusal left, and it names T
A T with NO storage row leaves Temporal<T> without one, because there is no declaration to
read — the wrapper does not invent a strategy for an element that has not stated one. The
sentence a reader acts on names T, which is where the missing row goes. The two blocks above
are this one’s positive twins: stable rustdoc runs a compile_fail block just far enough to see
it fail and never checks why, so the pair shares its shape and one half has to be positive.
use ingraph::{ListFilter, Temporal, ToDatabaseComparison};
struct Tag;
let _: Option<
<ListFilter<Tag> as ToDatabaseComparison<Temporal<Tag>, sqlx::Postgres>>::Comparison,
> = None;