Skip to main content

MutationModel

Struct MutationModel 

Source
pub struct MutationModel {
    pub krate: Path,
    pub name: Ident,
    pub vis: Visibility,
    pub graphql: Vec<GraphqlKind>,
    pub exchanges: Vec<ExchangeModel>,
}
Expand description

A validated mutation declaration, ready to emit.

PLAIN, for the reason every model in this crate has plain fields: the derive today and a manifest front end later reach the same emitter.

Fields§

§krate: Path

The path to the ingraph crate itself — ::ingraph unless #[ingraph(crate = "…")] named another.

§name: Ident

The declared type — the node the command enum and both impls are emitted for.

§vis: Visibility

The declaration’s own visibility, which the minted command enum wears: a node a caller can name has commands that caller can build.

§graphql: Vec<GraphqlKind>

The wire backends the graphql(…) word named, in the order it named them.

CARRIED and not yet spent — see the module note. It is a list rather than a flag for the index grammar’s reason: a second backend is a second word inside one block, not a second block.

§exchanges: Vec<ExchangeModel>

Every exchange, in declaration order — which is the order the command enum’s arms take.

Implementations§

Source§

impl MutationModel

Source

pub fn response_name(&self) -> Ident

The response sum’s name — the node’s own, with Response after it.

Derived rather than declared, for command_name’s reason: the node’s name IS the vocabulary’s name, and a second word for it would be a name two spellings could disagree about.

Source

pub fn error_name(&self) -> Ident

The error sum’s name — the node’s own, with Error after it.

Source

pub fn face_name(&self) -> Ident

The assembled face’s name — handle_ and the node’s own name in snake case.

Named after the NODE and not numbered, which is the ruling: a position in a list is a name that moves when the list is reordered, and the node is what the face is the capability of.

Source

pub fn awaited(&self) -> bool

Whether the assembled face is awaited — the OR law, read off the declaration.

Source§

impl MutationModel

Source

pub fn unit_name(&self) -> Ident

The wire unit’s name — the node’s own, with Mutations after it.

default_queries_name’s shape one family over, and derived for its reason: the node’s name IS the vocabulary’s name, and a second word for it would be a name two spellings could disagree about.

Source§

impl MutationModel

Source

pub fn command_name(&self) -> Ident

The command enum’s name — the node’s own, with Command after it.

Derived rather than declared, and there is no command(rename = "…") word: the node’s name IS the vocabulary’s name, and a second word for it would be a name two spellings could disagree about. A node that wants another name is renamed.

Source

pub fn all_sync(&self) -> bool

Whether EVERY handler here is blocking — the OR law’s own const, read the other way round.

Source

pub fn emit(&self) -> TokenStream

The whole expansion: the vocabulary, the row that hands it to a source, the record — and, where the declaration wore a graphql(…) word, the wire face over all of it.

Trait Implementations§

Source§

impl Clone for MutationModel

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 MutationModel

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.