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: VisibilityThe declaration’s own visibility, which the minted filter takes.
subject: IdentThe element the faces are OF.
krate: PathThe ingraph root the expansion spells its shelf through.
filter: RustSafeNameWhat the minted filter is called.
family: ElementFamilyThe family this element is read under.
member: MemberThe single field the element holds its value in — positional or named.
inner: TypeThat 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
impl ElementModel
Sourcepub fn emit(&self) -> TokenStream
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.