pub struct Delegate {
pub signature: Signature,
pub exclusive: bool,
pub wire: Vec<DelegateSkin>,
pub on_self: Option<Ident>,
}Expand description
ONE delegate(fn …) entry: the signature the declaration restated, how it takes its receiver,
and whether it is also PUBLISHED.
The three are one entry rather than three lists because each answers a different question about the same method, and two of them fork the emission: an exclusive receiver changes the BODY, and a published entry changes the declaration’s whole wire face.
Fields§
§signature: SignatureThe signature, exactly as the declaration wrote it — the emitted method’s head, verbatim.
exclusive: boolWhether the receiver is EXCLUSIVE (&mut self) rather than shared (&self).
A shared receiver FORWARDS and hands the answer back. An exclusive one has to reach a place it may mutate, which is a different body at every tier — a mirror materialises, mutates and converts home, at two conversions a call; a wrapper mutates the value it already holds, at none. This flag is what makes the fork, and the cost, visible.
wire: Vec<DelegateSkin>#[graphql(<backend>)] — the backends this method is published to, when it is published.
EMPTY is the ordinary entry: a delegated method is Rust and reaches no schema. What ONE entry carrying a backend does is the declaration’s own — a vocabulary mirror’s output seat is PROMOTED from a scalar to an object face, and a field fragment already has an object face and gains a field on it.
on_self: Option<Ident>on = self — the entry’s method lives on the DECLARED type rather than on the wrapped one, so
no forwarding half is minted for it.
None is the shorthand entry, which is every entry written before this word existed: the
emission mints its forwarding method exactly as it did. Some carries the self token that
named the target, kept for the span its refusals report at rather than for the word — self is
the whole of the roster today, and a second target is a door rather than a plan.
Implementations§
Source§impl Delegate
impl Delegate
Sourcepub fn word(&self, kind: GraphqlKind) -> Option<String>
pub fn word(&self, kind: GraphqlKind) -> Option<String>
The word a client writes this method as, at one backend: the declared rename, else the
method’s own name in lower camel case.
The ONE authority on that word. A front end refusing a collision has to spell exactly the name
the emitter publishes, and a second spelling on that side is how the two come to disagree —
which is union::seat’s own argument, one declaration over.