Skip to main content

At

Struct At 

Source
pub struct At<'a> { /* private fields */ }
Expand description

Where a predicate is being applied: the path naming the column, and the row it constrains.

§Why the row travels with the column

ComplexComparison::apply already takes schema knowledge from its caller, and says why: the name is rendered into the SQL text verbatim, and the caller owns it because the caller is the only party that knows the schema. A row’s table and key columns are the same kind of knowledge, so they arrive at the same place — and arriving HERE rather than at the crossing is what keeps TryFromFilter taking a filter and nothing else.

That is not a tidiness argument. The addressing genuinely is not part of a filter: tags: { overlaps: […] } is the same question whichever row it constrains, and only the address differs. A crossing that took the address would be claiming otherwise — and a comparison built from a filter alone can be applied against any row shape the caller names, which is the property that makes a generated comparison reachable from a GraphQL filter at all.

§The top level is the EMPTY path, and that is the whole reason this is a path

A generated comparison is the composite case: it is handed one address and each of its columns extends it. Under a single NAME there was no name to hand it that produced the right answer — a top-level Media predicate rendered media_title where the column is title, and applying one to its own row rendered frames_id beside a RecordAddress saying the column identifying that row is id. The address and the predicate disagreed about one column inside one call, and no naming convention reconciles them.

With a path there is nothing to reconcile: new names a row and no column, each layer pushes its own segment, and title falls out of the top level rather than being a case.

§A comparison over a COLUMN applied at the top level addresses none

The empty path names no column, so what a backend renders for one is the backend’s — the SQL family writes nothing, which makes the predicate around it a parse error rather than a name that might resolve.

Writing nothing settles only the forms that WRITE the column. A CORRELATED comparison has one that does not: its second table is the row’s own extended by the column’s path, and extended by nothing it IS the row’s, so the predicate correlates the row to itself and is well-formed and constant. Those kinds refuse the empty path outright — see SqlLoweringError::EdgeWithoutField.

Either way a column’s comparison belongs at a frame, and frame is the only way to make one.

§An address is a VALUE, and every receiver here says so

Two borrowed pointers and Copy, so an &At<'_> is a pointer to two pointers: the width of what it points at, one indirection more, and the opposite of how the builder travels through the very same signature. ComplexComparison::apply takes this BY VALUE for that reason, and the three accessors take self rather than &self for the same one.

The receiver is measured rather than matched to a habit. The emitter writes its calls qualified — At::frame(at, …) on the address its apply was handed — which against a &self receiver is one E0308 per emitted column, ten of them across ingraph-derive’s fixtures, reported at the #[derive] rather than anywhere inside the expansion a reader could look at. So &self would cost generated code a & at each such site and buy nothing back; nothing anywhere holds an At it cannot copy.

Implementations§

Source§

impl<'a> At<'a>

Source

pub const fn new(record: &'a RecordAddress) -> Self

The record row itself, at NO column — the TOP LEVEL, from which every column is a frame below.

Depth ZERO and no alias, which is the base scope: the outermost FROM names the real table. Every caller that had this signature keeps it, which is what let the two fields arrive without touching a line of generated code.

Source

pub const fn nested( record: &'a RecordAddress, enclosing: usize, alias: &'static str, ) -> Self

The record row as a nested scope sees it: one level deeper than enclosing, under the name that level’s FROM gave it.

The row is the TARGET’s rather than the enclosing one’s — a relation descends into a different table — so the address is passed rather than derived, while the depth is the enclosing scope’s plus one because that is what nesting means.

§The alias is &'static str, and that is the whole reason this is expressible

It is minted at EXPANSION and reaches here off SqlQuery::ALIASES, so it borrows nothing and adds no lifetime. A runtime-built name could not be held by a Copy address at all, which is the restriction RecordAddress’s note records — and the reason the table there is still the REAL one: a dependent table’s name is DERIVED from it, so the two roles had to be split rather than swapped.

Source

pub const fn aliased( record: &'a RecordAddress, alias: &'static str, keys: &'a [&'static FieldName], ) -> Self

The record row as a row source the ENCLOSING FROM already named: at depth zero, under alias, with its key columns projected under keys.

§It is the third shape, and a UNION’s derived table is what needed it

new says the outermost FROM names the real table and nested says a subquery one level in renamed it. A derived table is neither: ( … ) AS "__ig_union__" is the statement’s OWN level — nothing is nested and the predicate is the outer WHERE — and the row is under a name that is not its table’s. Spelling it as nested would claim a scope that is not there, which is the axis a nesting kind indexes SqlQuery::ALIASES with.

§The RECORD stays the member’s REAL one, and that is the whole of why this is safe

A dependent table’s name is DERIVED from the row’s real table — edge_table extends it — so an address naming the alias would name a table that does not exist, which is the hazard RecordAddress’s own note warns of. Here the two roles are held apart: record is the member’s, so reel_marks derives; the alias is the union’s, so a correlation compares against the name the enclosing FROM gave.

keys is the other half of the same split — see parent_keys.

Source

pub const fn parent_keys(self) -> Option<&'a [&'static FieldName]>

What the enclosing scope calls this row’s KEY columns, where it does not call them by their own names — and None where it does, which is every scope that selects the row’s own table.

§Two facts that were always two, spelled as one until a union broke the coincidence

A correlation compares an edge table’s parent-key column against the parent row’s. The FIRST is named after the row’s own address column, because that is what the CREATE TABLE for the edge wrote; the SECOND is named whatever the parent SCOPE projects it under. Selecting a real table makes those one string, and every record’s lowering lived on that coincidence.

A union’s arms project each member’s address column AS "id", so the coincidence breaks: the edge side wants the member’s own name and the parent side wants "id". This is where the second fact is stated when it differs, POSITIONALLY against RecordAddress::keys — and a shorter list leaves the columns past its end naming themselves, which is the answer None gives for all of them.

Source

pub const fn depth(self) -> usize

How many correlated scopes enclose this one — zero at the statement’s own level, one inside a relation’s subquery, two inside a relation inside that.

It is what a nesting kind indexes SqlQuery::ALIASES with, and depth is the right axis rather than an occurrence counter: an alias is scoped to the subquery that states it, so two SIBLING subqueries may name their row sources alike and neither can see the other’s. What must differ is a name and the name it nests inside.

Source

pub const fn qualifier(self) -> &'a str

The name a qualified reference to this row must use: the alias if the enclosing FROM gave one, and otherwise the table’s own name.

§It is NOT RecordAddress::table, and the two are different questions

This one answers what is this row called HERE, which is what a correlation compares against. The other answers what is this row’s table, which is what a dependent table’s name is derived from — edge_table extends it, and extending an alias would name a table that does not exist. Every qualifier reads this; every derivation reads that.

A &str rather than a FieldName, because the two sources have different types and the bracketing takes either: a table is a &'static FieldName and an alias a &'static str.

Source

pub const fn path(self) -> Option<&'a Path<'a>>

The segments naming the column this predicate is applied to, or None at the top level.

A Backend reads this to render one; nothing else has to, because a kind asks the backend for the column rather than building the name itself.

Source

pub const fn record(self) -> &'a RecordAddress

The row this predicate constrains.

Source

pub const fn top(self) -> Self

The same SCOPE at no column — this row’s top level, keeping the depth and the alias.

It is what a kind that opens a derived scope of its own hands the comparison inside it: the element of a collection is addressed at the row’s top level framed by one segment, and the row it belongs to is the row this address names, under the name this scope already calls it. An At::new(at.record()) there would have reset both fields and correlated an inner predicate to a table name the enclosing FROM had renamed.

Source

pub const fn frame(self, name: &'a FieldName) -> Frame<'a>

The same row, one segment further down: bind the frame to a local, then address through Frame::at.

Two lines rather than one, and the frame is the reason — the child address BORROWS its path from it, so the link has to live somewhere the child can point at, and the caller’s stack is the only place that costs nothing.

Trait Implementations§

Source§

impl<'a> Clone for At<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for At<'a>

Source§

impl<'a> Debug for At<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for At<'a>

Source§

impl<'a> Hash for At<'a>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> PartialEq for At<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for At<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for At<'a>

§

impl<'a> RefUnwindSafe for At<'a>

§

impl<'a> Send for At<'a>

§

impl<'a> Sync for At<'a>

§

impl<'a> Unpin for At<'a>

§

impl<'a> UnsafeUnpin for At<'a>

§

impl<'a> UnwindSafe for At<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Fruit for T
where T: Send + Downcast,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<K> PositionKey for K
where K: Clone + Eq + Hash + Send + Sync,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> RootKey for T
where T: Clone + Eq + Hash + Send + Sync + 'static,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> State<Identity> for T

Source§

type Output = T

The type Self projects to.
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more