Skip to main content

Module composed

Module composed 

Source
Expand description

The COMPOSED MODE’s model — the wire face of a filter struct somebody wrote by hand, built out of its own fields. THE COMPOSED MODE’s model: what #[derive(ingraph::Filter)] emits when the declaration wears #[ingraph(composed)] — the wire face of a filter struct somebody wrote by hand, built out of the fields themselves.

§The struct IS the vocabulary, and that is the whole of the mode

The other two identities take a declaration and MINT something: the struct mode mints a filter over a row’s columns, the element mode mints one over a single value. This one mints no type at all. The subject already IS the filter — its fields are the operator slots, in the order they are written — and what the derive adds is the face a client reaches it through.

So the FIELD TABLE has exactly one author. A hand-written face carries the field list three times — once in the registration, once in the parse, once in the render — and keeping the three in step is a discipline rather than a fact. Here the three are one list walked three times, and the list is the struct body: a field cannot be registered and not parsed, or rendered under a name the registration never published, because there is nowhere for a second list to live.

§TWO kinds of field, and the second one publishes NAMES THIS DECLARATION DOES NOT SPELL

An operator SLOT is one name, one wire type, one key in the parsed object. A SPLICED component — #[ingraph(flatten)] — is a whole filter face whose own fields become this filter’s, so the declaration’s field list and the published table are no longer the same length. See FlattenFace, which is where the four faces splice.

§What it emits, and what it deliberately does not

itemwhat it says
async_graphql::InputTypethe three faces — the registration, the parse and the render
async_graphql::InputObjectTypethat the registration above is an input OBJECT
NullableFacethe two halves Nullable<F>’s single blanket assembles the twin from
GraphqlFilteremptiness, folded field by field

It emits no constructor, no accessors and no inherent is_empty. The struct is hand written: its new, its with_* family and whatever inherent reads it publishes are the author’s, and a door that also emitted them would be E0592 against the ones already there. GraphqlFilter is the one emptiness answer this door writes, and an inherent is_empty beside it still wins method resolution — which is the arrangement every filter kind in ingraph already has.

The LOWERING is untouched. A composed filter reaches a dialect the way it always did, through whatever ToDatabaseComparison row its author wrote; this door is about the wire and says nothing about the storage side.

§The SHAPE of each slot is resolved by the compiler

Which of the four shapes a field is cannot be read off its tokens — Option<Rate> and Option<ScalarFilter<i32>> are one shape to a parser — so every emitted line goes through FilterSlot/SlotFace, writes the kind as _, and lets inference pick the one row that applies. A field answering none of them is E0277 carrying that trait’s own sentence and naming the field’s type; a field answering two is an ambiguity at the declaration rather than a silent choice. See ingraph’s graphql::filter::slot for the rows and for the emptiness law.

Structs§

ComposedField
ONE field of a composed filter: the member it is held in, its type, and which kind of field it is.
ComposedModel
A hand-written FILTER STRUCT, as the composed mode reads it.

Enums§

ComposedKind
WHICH KIND of field one member of a composed filter is.

Functions§

default_sdl_name
The schema name a composed declaration takes when it renames nothing: its OWN, unraw’d.
wire_name
The client’s name for a slot NO declaration renamed: the household fold — a raw prefix dropped, a trailing underscore eaten, the rest lowerCamel.