Skip to main content

FragmentField

Struct FragmentField 

Source
pub struct FragmentField {
    pub column: Column,
    pub flatten: bool,
    pub build: Build,
    pub docs: Vec<Attribute>,
    pub condition: Condition,
    pub stored_name: Option<String>,
    pub wire_name: Option<String>,
    pub skip: Option<Fill>,
    pub derived: Vec<Derived>,
    pub write: Option<Path>,
    pub read: Option<Path>,
}
Expand description

ONE field a fragment declares: the COLUMN every face reads, and the documentation the declaration wrote above it.

A Column rather than a Field: a Field carries identity and a reference, and a fragment has neither to carry. What is left — the name, the written type and the projection its accessor hands it back by — is exactly a column.

The DOCS are a seat of their own because the REWRITE deletes the field that held them. An ordinary fragment keeps its fields, so their doc comments stay where the author put them and nothing here has to carry one; a fragment that wraps a foreign type has no such field left, and the reader is the one place that field’s meaning is still answerable. Beside the column rather than in a list of their own, for the reason comparison states about the two column lists it refuses to keep: two lists that agreed today are two lists that can drift.

Fields§

§column: Column

The column — the name, the written type and the projection.

§flatten: bool

record(flatten) — whether this field lends its name to the columns beneath it.

§It is the INNER mount’s word, and it names no database

A record scopes the same decision per database — <db>(flatten) rides that row’s own column list — and a fragment has no such list to scope it in: the layout a fragment publishes is ColumnKind::SEGMENTS, which carries no dialect and is measured not to want one. So the word here is written without a database and means what the type means: this field’s segments are columns of the FRAGMENT’s own namespace, wherever that namespace is eventually laid out. record(<db>(flatten)) is refused by name for exactly that measurement.

false is the default and is the bare TYPE POSITION’s own answer — a field whose type holds several values is stored as those values, prefixed with the field’s name.

§build: Build

What this field’s builder(…) said about its place in the wrapped type’s CONSTRUCTION — its seat, its crossing, and the two words that stand on their own.

Carried in BOTH modes and spent in ONE, exactly as docs is: an ordinary fragment IS its fields, so a raise writes the struct literal and there is no call sequence for a word to describe. The grammar refuses every construction word on such a declaration by name, so a spent-nowhere value here is the default and never an author’s silently-dropped sentence.

§docs: Vec<Attribute>

The field’s own doc comments, /// and #[doc = "…"] alike, in the order they were written.

Empty is the ordinary case and means exactly what it says: nothing was written, or nothing has to be carried.

§condition: Condition

The #[cfg]s this field is declared under, and the #[cfg_attr]s that decorate its stand-in.

§The tier used to have no seat for one, and five faces emitted over the hole

crate::remote’s own note promised a manifest field’s cfg the reader, the column in every database, the filter seat, the order-by term and the place on the wire face, all together, and this tier had nowhere to keep it: the field was accepted, the reader emitted unconditionally, and a negative predicate produced an expansion naming a field the build had removed. The measurement, on a two-field fragment with one gated field: six errors — three E0615 at the accessor family and one E0560 at the raise’s struct literal, plus the pair rustc adds — with #[cfg_attr(pred, ingraph(…))] beside it dropped in silence, which is the exact failure that refusal exists to prevent.

So the seat is the record family’s, read by the same attribute::condition and spent by the same two spellings: Condition::gate wherever an attribute may sit, and Condition::present summed by [crate::emit::positions] wherever an ORDINAL indexes a list the predicates contract.

§Two limits, both the family’s own and neither this tier’s

A WHERE-PREDICATE takes no attribute, so the obligations a conditional field contributes stay in the clause whichever way its predicate goes — the record’s element crossings say the same thing at their own seat. And a CURSOR KEY member may not be conditional at all: a key that contracted would page by a different order than the one that wrote the cursor, so the front end refuses it by name.

§stored_name: Option<String>

record(rename = "…") — what this column is CALLED where it is stored, or None for the field’s own name.

§One axis moves and the other does not, which is what ColumnName is for

A column has two names: what the DECLARATION calls it — the axis a filter, a comparison and an order all speak in — and what a STATEMENT renders, which is what an engine resolves. The record seat’s bare rename moves the second and leaves the first, and this is that word one namespace in, meaning exactly what it means there.

It is DIALECT-FREE where a record scopes a second one per database, and that is the same measurement flatten rides: a fragment publishes one ColumnKind::SEGMENTS carrying no dialect, so there is no second list for a second database’s name to be written into.

None means nothing was written exactly, and a fragment that renames nothing expands token for token as it did before the word existed — the shape entry stays ColumnName::of, the spelling for a column whose two names are one string.

§wire_name: Option<String>

graphql(rename = "…") — what a client calls this field, or None for the fold of its own name.

ONE word for the two surfaces a field publishes: the object’s member and the filter’s slot are one field’s name on the wire, and a record’s own face reads them off one declared name for the same reason. The fallback is not stored here — it is wire_member’s camelCase fold, computed where it is spent — so None means nothing was written exactly.

§skip: Option<Fill>

record(skip) / record(skip(default = "…")) — the DECLARED ABSENCE, and what fills the read.

The record field seat’s own skip, one namespace in and meaning exactly what it means there: no column in ANY database. Under the inversion law a bare field IS a column, so this is the one declared exit — and the fill is what makes it an exit rather than a hole, a read having to supply the value the row does not carry.

What it subtracts is every STORAGE answer and the predicate with it: no segment, no name, no bind, no read and no filter slot, per the ruled law that each face walks its own participation set and the filter follows storage. What it does NOT subtract is the tier’s own value face — the accessor family and the place on the wire object — because those are what the declaration IS rather than what a holder asked for.

It is refused beside cursor: the key is every declared field, and a member with no column is one the SQL keyset cannot compare.

§derived: Vec<Derived>

record(derived(column = "…", from = "…", type = "…")) — the columns this field’s declaration adds to the layout and the WRITE computes, in the order they were written.

skip’s mirror image, and the pairing is exact: a skipped field is declared-but-not-stored and the raise fills it, a derived column is stored-but-not-declared and the write computes it. So the two words are refused beside each other — a field with no column in any database has no place in the layout for a column to follow.

EMPTY is the ordinary case and is what every declaration written before the word existed carries, so a fragment deriving nothing expands token for token as it did.

§write: Option<Path>

record(write = "…") — the function this field’s value passes through on its way to storage, or None for the value as it stands.

§ONE function, TWO sites, and that is the whole of what the word buys

The type layer preserves the DECLARED spelling — a container that says 2/4 is held as 2/4 — so canonicalisation is forbidden at the constructor door and belongs at the STORAGE boundary. A hand-written household does it by discipline, calling Rate::reduced() at the bind AND at the crossing’s query operand, and the two-sites-one-function agreement is the entire reason an index answers eq exactly: store 2/4 unreduced in one row and a client asking eq(1/2) misses it.

So the word is spent twice — carrier wraps the accessor, and both crossing arms map the operand through the SAME path — and a golden pins that the two agree. Spending it at one site only manufactures the exact miss the seat exists to kill.

§fn(&T) -> T, pinned in a const no feature gates away

transforms writes const _: fn(&T) -> T = path; per declared transform, so a path that resolves to nothing is E0433 and one whose signature disagrees is E0308, both at the string the author wrote. The device is the derived seat’s, one shape in: there the function is a never-called ARGUMENT because a ColumnShape had to be built anyway, and here there is no artifact to build, so the pin is the const’s own type.

None means nothing was written exactly, and a fragment transforming nothing expands token for token as it did before the word existed.

§read: Option<Path>

record(read = "…") — the function a stored value passes through on its way back, or None for the identity.

write’s optional mirror, for the household whose stored form is not a domain form. ABSENT MEANS IDENTITY, and that is the canonicalisation case rather than an oversight: a reduced rational is a valid Rate, so nothing has to be undone on the way out.

It is the READ’s word alone — assemble wraps the fetch — and it reaches no other face: a filter operand is a client’s value travelling INTO storage, which is write’s direction.

Trait Implementations§

Source§

impl Clone for FragmentField

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 Debug for FragmentField

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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