pub struct InterfaceField {
pub name: Ident,
pub ty: Type,
pub tier: Tier,
pub marker: Option<Marker>,
pub copy: bool,
pub pins: Vec<Pin>,
pub wire: Option<Type>,
pub operands: Vec<Operand>,
pub members: Vec<MemberColumn>,
}Expand description
One field of the contract: what every member has, and how.
Fields§
§name: IdentThe field’s name — the contract method’s name, and the row column’s.
ty: TypeThe DOMAIN type, as the declaration spelled it.
tier: TierWhich tier the field is in.
marker: Option<Marker>The INTERPRETATION word the pin declared — list(scalar), string, label = "a::Path" — or
None where the type answers for itself.
§A pin’s word is the record’s own, and the two readers it splits are what it is FOR
A collection column has two stored readings and they are different types: the member’s ROW
holds the LIST, and the comparison a filter crosses into is keyed on the ELEMENT the database
stores. Nothing about type = "Vec<u64>" and persist(sqlite(type = "i64")) says which of the
two the pin is — type Ids = Vec<Uuid7> and a scalar are the same tokens — so before the word
there was one reading, it was the wrong one at one of the sites, and a collection contract
field was E0308 at the row equation.
The record settles the same question the same way, which is what makes this precedent-consistent
rather than a second grammar: its collection interpretation IS word-declared
(Label), and this reads the very same vocabulary through the very same
front-end door.
InterfaceField::collects is what every reader asks; the marker itself reaches
InterfaceModel::filter_of, where it picks the filter KIND exactly as a record’s does.
copy: boolcopy: the type is cheap enough to hand back by value.
A CLAIM the emitter cannot check, exactly as Projection::Copied
is: a model carries names and types, not trait implementations, so a field marked copy whose
type is not Copy produces a contract implementation that does not compile — at the member,
naming the field.
pins: Vec<Pin>What each database stores the field at, where the declaration pinned one. Never two for one database.
Empty is not “stored nowhere”: a database with no pin stores the field at the DOMAIN type,
which is the uniform mapping stored_type carries for the record’s rows as well.
wire: Option<Type>graphql(type = "…") — the WIRE FORM, when it is not the domain type.
Held rather than spent, and what it is waiting for is the SDL. The filter object deliberately
does not read it: an operand’s filter and the comparison’s are ONE kind or the crossing between
them cannot be written, and a wire form that moved a u64 onto a String would move the
operand’s filter from the scalar kind to the text one. What a declared wire form is for is the
name a schema publishes, and no schema is rendered here — so the entry stays read-and-held
rather than spent on the one face it would make unwritable.
operands: Vec<Operand>graphql(input(comparison(<db>(try_into = "…")))) — what carries this field’s OPERAND across
into one database’s stored form. Never two for one database.
The declared leg REPLACES the whole chain for that database, which is the grammar’s own law:
a field with no entry crosses through the stored type’s own TryFrom, and one with an entry
crosses through the named function and never asks the type. Empty is the former.
members: Vec<MemberColumn>members(<Variant>(field = "…")) — what ONE member calls this field, where it calls it
something else.
Never two for one variant, and never a variant the enum does not declare: both are refused at the declaration, which can check them because the member set and the contract are ONE derive input. That is the whole reason the rename lives HERE rather than on the member — a member-side word would have to cross a derive boundary, and only a type or a const does that, neither of which produces the IDENT a field access needs.
Empty is not “no member calls it anything”: InterfaceField::column is the one place the
default is resolved, and the default is the interface’s own field name.
Implementations§
Source§impl InterfaceField
impl InterfaceField
Sourcepub fn pinned(&self, kind: DatabaseKind) -> &Type
pub fn pinned(&self, kind: DatabaseKind) -> &Type
The type ONE database’s row carries this field at: the pin, or the domain type.
Through stored_type, which is the mapping a record’s own row already takes, so an
interface pinning nothing and a record declaring nothing agree by construction rather than by
two functions happening to say the same thing.
A COLLECTION’s unpinned answer is its own type and not its element’s, which is why every
reader that wants a stored VALUE goes through InterfaceModel::stored_at instead: a pin
names what a database keeps ONE element at, and the domain type is the list of them.
Sourcepub fn collects(&self) -> bool
pub fn collects(&self) -> bool
Whether the pin’s word named a COLLECTION — the one question the word answers for every reader here, asked in one place so the two readings of a pin cannot disagree about which fields are many-valued.
A marker the DECLARING crate owns (label = "a::Path") answers NO, which is the limit
Marker::resolved already has and the same one the record’s own
collects has: what the framework did not name, it cannot classify.
Sourcepub fn collection(&self) -> Option<Label>
pub fn collection(&self) -> Option<Label>
WHICH collection word the pin declared — the shape its members’ edge tables have, and the one fact the consistency equation is written about.
Sourcepub fn operand(&self, kind: DatabaseKind) -> Option<&Path>
pub fn operand(&self, kind: DatabaseKind) -> Option<&Path>
The function ONE database’s predicate carries this field’s operands across through, where the declaration named one.
Sourcepub fn column(&self, variant: &Ident) -> &Ident
pub fn column(&self, variant: &Ident) -> &Ident
What ONE member calls this field: the declared rename, or the interface’s own name.
The ONE place the default is resolved, and THREE consumers read it — the member’s own contract
impl, which accesses that struct field; the row equation, which accesses the same name on that
member’s row; and the arrangement layer, which will render <column> AS <field> once there is
a query to render it into. A default spelled at three sites is how two of them come to
disagree about a column nobody renamed.
Matched UNRAW’D, which is the rule the front end’s own block-key check runs on: r# is Rust’s
escape for a word that collides with its grammar and no part of the name, so a variant is one
name however it had to be spelled.