Skip to main content

ElementModel

Struct ElementModel 

Source
pub struct ElementModel {
    pub vis: Visibility,
    pub subject: Ident,
    pub krate: Path,
    pub filter: RustSafeName,
    pub family: ElementFamily,
    pub member: Member,
    pub inner: Type,
    pub wire_name: Option<String>,
}
Expand description

A declared ELEMENT, as the element mode reads it.

PLAIN, for StandaloneModel’s reason — public fields, no constructor, no validation. What is checked is checked at the FRONT END, where the tokens an author wrote are still in hand and a refusal can point at one.

Fields§

§vis: Visibility

The declaration’s own visibility, which the minted filter takes.

§subject: Ident

The element the faces are OF.

§krate: Path

The ingraph root the expansion spells its shelf through.

§filter: RustSafeName

What the minted filter is called.

§family: ElementFamily

The family this element is read under.

§member: Member

The single field the element holds its value in — positional or named.

§inner: Type

That field’s type, which is what the element crosses the wire AS.

§wire_name: Option<String>

graphql(rename = "…") — what a SCHEMA calls this element’s scalar, where the declaration moved it.

None is the Rust name unraw’d, which is what ElementModel::sdl resolves. EMISSION-ONLY: the declared type keeps its name, the minted filter keeps filter(rename = "…"), and the two crossings are written for the Rust type either way.

Implementations§

Source§

impl ElementModel

Source

pub fn emit(&self) -> TokenStream

The whole element mode, emitted.

ONE SHAPE, at four doors. Half of it belongs to the FILTER — the minted type, its accessor face, the emptiness contract, the lowering map, the operand map and the input object — and half to the ELEMENT: the readings a field resolves through, and the scalar and the two crossings only a declaring crate can write. The family decides what is IN each item and never which items there are.

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> 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, 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.