Skip to main content

Delegate

Struct Delegate 

Source
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: Signature

The signature, exactly as the declaration wrote it — the emitted method’s head, verbatim.

§exclusive: bool

Whether 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

Source

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.

Trait Implementations§

Source§

impl Clone for Delegate

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 Delegate

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.