Skip to main content

Module fields

Module fields 

Source
Expand description

The FIELD-FRAGMENT TIER’s model — the fields a holder inherits, and the width they occupy. The FIELD-FRAGMENT TIER’s emission — the faces a value has, and none of the faces a NODE has.

A fragment is 公用字段抽取: a group of fields several declarations hold, written once. It is the BOTTOM RUNG of the record family’s ladder — held rather than declared — and every absence below follows from that single fact rather than from an era rule or a missing layer:

  • no Identifiable, because it bears no id — that is what the tier MEANS, and a fragment’s identity, when a question about one arises at all, is its holder’s;
  • no Transformer, whose whole content is a key and the two address types beside it;
  • no Graphql, because a fragment is not a queryable ROOT and a root is what that face is;
  • no storage of any kind, because a fragment’s columns are the HOLDER’s row.

The rung above is entity, which bears an identity and no rows; above that is record, which bears both. The three are one ladder and each word names what its rung HAS.

§The three FACES, and why none of them is a family word

What a fragment HAS is a width and the questions that follow from it. A holder’s emission never learns what a fragment is — nothing in emit::graphql names this tier, before these faces or after them — because every seam a holder reaches a column’s type through is a PROJECTION the type answers:

the holder writesthe fragment answers with
shape::<Ty>(…) in its column listColumnKind — the WIDTH
<<Ty as DefaultMarker>::Marker as ToGraphqlFilter>::{Filter, ColumnFilter} in its filterfilter — the two marker rows, and the up-to-two predicates they name (the author’s, where filter = "…" mounted one)
<That as ToDatabaseComparison<Ty, Db>>::Comparison in its predicatecomparison — one conjunct per field, each one segment down

So the faces are ANSWERS to questions the holder was already asking, and the tier’s absences are untouched: what is stated here is a column layout, a predicate over it, and the reading that resolves the two — never a node’s identity, its rows, or its place as a query’s root.

Beside them is the fragment’s own API — one accessor family per field — which is what Column already emits for a record. The reuse is the point: a fragment’s fields are read exactly as a record’s are, and a second shape for the same thing is what this file exists not to be. The filter and the comparison keep that discipline one layer up, being [unit]’s own walks — the same two a record and a standalone struct compose.

§What a holder does with one is not here

The field grammar a fragment declares — the labels, the storage legs, the wire legs — is inherited by every holder. Nothing reads that yet, so nothing here carries it: the model holds what this emission spends and grows when the inheritance arrives to spend the rest.

The holder-side word that DOES exist is a naming act rather than a divergence: persist(<db>(flatten)) decides whether one database drops the prefix a held fragment’s columns are laid out under, and it asks nothing of this tier — the holder’s own PersistColumn carries it. What it DOES ask of the fragment is the refined crossing, and comparison is where that is answered.

§The REWRITE mode, and the seat this tier does not have

remote = "…" makes a declaration a transparent wrapper over a type another crate owns, and fields is the FOURTH declaration to take it — after entity, record and the vocabulary kinds. The device is crate::remote’s and is shared rather than re-implemented: the same bridge, the same reference family, the same escape.

What is this tier’s own is the ABSENCE. A record’s rewrite splits every read on identity — an id column is borrowed, because this framework’s identity seats borrow, and a data column crosses by value — and a fragment bears no id, so the split has one branch. The manifest’s columns are all equal: one by-value reader each, no _ref, no id_ref, no identity seat to serve. The id word is refused at the front end, so an identity-bearing manifest field never reaches this emission.

The four FACES above are untouched by the mode, and that is the point of restating a foreign type as a manifest at all: a width, a filter slot, a comparison conjunct and a wire member are read off a declared NAME and a declared TYPE, which a manifest states exactly as a held field does. The one place the mode is visible in a face is the wire object’s resolver — see wire, where a measured E0515 forced the arm to HOLD its value in ingraph::Crossed rather than borrow one it does not own. What a client reads is unmoved by that: the adapter delegates every name to the same crossing the held arm returns through.

Structs§

BuiltFor
ONE dialect this fragment is BUILT for, and whatever lowering it mounted there.
Derived
ONE column a WRITE computes — record(derived(column = "…", from = "…", type = "…")), attached to the field it is derived from.
FieldsModel
A validated fragment: what it is called, how visible it is, and the fields every holder inherits.
FragmentField
ONE field a fragment declares: the COLUMN every face reads, and the documentation the declaration wrote above it.
RecordHost
The RECORD-HOST activation: record, and the dialects the declaration named inside it.
WireFace
The WIRE activation: graphql, and the two SDL names its block may move.