pub enum Role {
Show 30 variants
Key,
Lineage,
Row(DatabaseKind),
Kind,
UnwrapError,
Id,
Fields,
Derivations,
Comparison(DatabaseKind),
Cursor(DatabaseKind),
Input,
Output,
KeyOutput,
KeyInput,
Filter,
OrderBy,
Queries,
In,
Out,
OutKind,
Downstream,
Due,
Channels,
Grants,
Lending,
Sweeps,
Election(Ident),
Slot(Slot),
Fuse,
Answer(Ident),
}Expand description
Which of a declaration’s emitted types one is — the phrase a refusal names it by.
A vocabulary rather than a description built at the site, so the sentence a front end writes
about a type has one author. method::Owner asks a neighbouring
question and is deliberately not this: it names the types that host METHODS, so it carries the
record itself — which no emission declares — and lacks the wire key, which declares none.
§It is NOT Copy, and the two variants that took that away are the ones that had to
Every role above Election names a type a declaration has AT MOST ONE of, so
the variant alone identified it. A derived index mints one marker per ELECTION and one per
(field × engine) SLOT, so a slot’s marker names as many types as the declaration has slots —
and a refusal that could not say WHICH would leave an author with two markers of one name and no
way to tell which pair minted either. The identifying tokens therefore ride the variants, which
costs the trait’s bit-copy and buys the sentence.
Variants§
Key
The *Key.
Lineage
The *Lineage, for a record that has one.
Row(DatabaseKind)
One database’s row.
Kind
An INTERFACE’s discriminant — which member a row of its projection came from.
The four variants below it are an interface’s too, and they are here rather than in a vocabulary of the interface’s own because the question this enum answers is which of a declaration’s emitted types is this — and an interface is a declaration. Two vocabularies would make a front end’s collision refusal read differently depending on which derive wrote the type. That a record’s emission produces none of them is what every variant here already is for some declaration and not for another.
UnwrapError
The refusal a wrong-variant unwrap answers with.
Id
An INTERFACE’s address — the sum over its members’ own ids.
Fields
An interface’s CONTRACT trait.
Derivations
An interface’s DERIVATIONS trait.
Comparison(DatabaseKind)
One database’s comparison.
Cursor(DatabaseKind)
One database’s cursor value — the record’s sum over its orderable columns, in the types that database stores.
Input
The wire argument object.
Output
The wire output object.
KeyOutput
The wire key object.
KeyInput
The wire key ARGUMENT object — the address a client SENDS, for a record whose key has more than one column.
Conditional where every other wire face here is unconditional, and the condition is the key’s
own arity rather than a word: a ROOT record’s key is its id, and an id already crosses inward
through ToGraphqlInput at every filter and get
position — so wrapping one in a single-field object would publish a shape the id’s own row
already answers. A COMPOUND key has no such row, and this is the type that gives it one.
Filter
The wire filter.
OrderBy
The wire order-by.
Queries
The wire QUERY UNIT — the trio a root folds, for a record whose declaration reaches one.
In
The FAN-IN sum — one variant per upstream of a subscribe(…) container.
Out
The PRODUCT sum — one variant per product emits named, for a node that declares several.
OutKind
The product VOCABULARY — the identities of an Out’s arms.
Downstream
The node’s own DOWNSTREAM — one out-edge slot per declared product.
Due
The POLL vocabulary — one variant per poll(…) entry, for a node that declares any.
Channels
The CHANNELS shelf — one field per upstream(…) entry, for a node that declares a container.
Grants
A CLOCK’s GRANTS CONTEXT — one per poll(…) entry that wrote a write word.
Lending
The LENDING — the value a deployment hands the runtime, holding one clock’s context per granting entry, the citizen each mounted entry runs and the executor each detached one runs on.
Sweeps
The SWEEP TRAIT — one entry per light clock, which is where an author writes a sweep.
Election(Ident)
A DERIVED INDEX’s ELECTION MARKER — <Index>By<Field>, carrying the field it elected.
Slot(Slot)
A DERIVED INDEX’s SLOT MARKER — <Index><Field><Engine>, carrying the pairing that minted it.
The pairing and not the name, because the name is what a collision has TWO of: the durable slot
NAME keeps its segment boundary (__-joined) where the marker’s camel-case join cannot, so the
only way to tell two colliding markers apart is the field and the engine each came from.
Fuse
One type of a derived index’s FUSE FAMILY — an options package, a question package, a fold vocabulary or the column vocabulary. The NAME says which; the role says only whose family.
Answer(Ident)
One type of an ELECTION’s ANSWER FAMILY — the question a query field takes, and the hit shapes it answers with — carrying the election it is about.
Separate from Fuse because the two families sit on opposite sides of a call: a
fuse type is what a REQUEST is built from and is minted whether or not the declaration wears a
backend word, where these exist only where a query field does. The field is carried for
Election’s reason — it is the token an author moves to clear a collision,
where an engine word names a real engine and is not free to be renamed.
Implementations§
Source§impl Role
impl Role
Sourcepub const fn at(&self) -> Option<&Ident>
pub const fn at(&self) -> Option<&Ident>
The DECLARED token a refusal about this type points at, or None for a name no declaration
wrote a part of.
Origin::column one axis over, and the same argument: a name
built through format_ident! carries the macro’s own call site, which is the span E0428
already reports at and the reason these rules exist. Every role a record or an interface emits
is either renamed by a word the front end holds or defaulted off the declaration’s own ident,
so those front ends point at what they hold; a derived index’s markers are built from a FIELD
and an ENGINE WORD, and the field is the token an author moves to fix a collision — an engine
word names a real engine and is not free to be renamed.