pub struct ExchangeModel {
pub field: Ident,
pub ty: Type,
pub rename: Option<LitStr>,
pub handler: HandlerModel,
}Expand description
ONE field of a mutation node: the exchange, and the words written beside it.
Fields§
§field: IdentThe field’s own name.
ty: TypeIts type — an exchange, which the emission asserts by projecting Mutation off it.
rename: Option<LitStr>The rename = "…" word, or nothing where the declaration wrote none.
handler: HandlerModelThe handler(…) block, which no field may omit.
Implementations§
Source§impl ExchangeModel
impl ExchangeModel
Source§impl ExchangeModel
impl ExchangeModel
Sourcepub fn published(&self) -> String
pub fn published(&self) -> String
What the wire publishes this exchange as: its rename = "…" word, or its field name with a
lower-case initial.
The convention lives HERE and not in the declaration record, which answers None for an
unrenamed field on purpose — what an unrenamed field is PUBLISHED as is the binding’s decision,
and the record putting its own guess there would be the record deciding it.
The fallback is [wire_member], which is the crate’s ONE answer to what a client sees where
nothing was written — the same camelCase the record family’s own faces fall back on, read from
the same function, so a mutation field and a record field never come to disagree about it.
Source§impl ExchangeModel
impl ExchangeModel
Sourcepub fn variant(&self) -> Ident
pub fn variant(&self) -> Ident
The command arm this exchange mints.
heck’s upper camel case and not emit::raise_initial — the opposite of the
choice a PUBLISHED word gets, and for the same law: a Rust field name is snake case by the
language’s own convention rather than by anybody’s choice, so re-casing it is a translation and
not a rewrite of somebody’s word.