pub struct EmissionPrefix(/* private fields */);Expand description
The mark a framework’s emitted names are minted under — __ig for ingraph itself.
§It holds the mark WITHOUT the joining underscore
__ig, not __ig_: the separator belongs to the join rather than to the namespace, because the
two shapes this mints — framed and prefixed — place it
identically and a mark carrying its own would make one of them spell a double. It is also the
shape the FENCE reads: a declared name is refused for starting with the mark, and a fence
holding __ig_ would let a column called __ig itself through.
§Cow, because both occupants are real
The framework’s own mark is a &'static str and costs nothing to carry; a front end computing
one — from a manifest, or from a domain crate’s own configuration — owns a String. A Cow
serves both without making the common case allocate, and INGRAPH is const
for the same reason.
Implementations§
Source§impl EmissionPrefix
impl EmissionPrefix
Sourcepub const INGRAPH: Self
pub const INGRAPH: Self
ingraph’s own namespace — the answer every model this repository’s derive builds carries.
It reads crate::alias::ALIAS_PREFIX rather than re-spelling it, so the string lives in one
place and the alias mint, the companion column and the injected fields cannot drift apart.
Sourcepub fn new(mark: impl Into<Cow<'static, str>>) -> Self
pub fn new(mark: impl Into<Cow<'static, str>>) -> Self
A domain framework’s own mark.
Nothing is checked here: refused is where the rules are, and it is spent by
the front end that has a span to report at. A mint that validated would be answering a
question its caller has already had to answer — the arrangement
crate::alias::alias already keeps one module over.
Sourcepub fn mark(&self) -> &str
pub fn mark(&self) -> &str
The mark itself, for the two places that need the bare string: the FENCE a front end holds declared names to, and the alias mint that spends it as a byte budget.
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Whether this is the framework’s own — the question a front end asks about the SEAT.
It is what says this model moved nothing, and it is why a declaration under the default mark expands byte for byte as it did before this seat existed.
§It is NOT the question an emission asks before staying silent
That one is
InterfaceModel::mints_the_default_words,
and it compares against ingraph’s own constant rather than against this — because what an
emission may leave unsaid is decided by what the ENGINE already believes, and the engine holds
one default whoever built the model. The two coincide for ingraph’s front ends and part
company for a platform’s, which is exactly where the distinction earns its keep.
Sourcepub fn framed(&self, word: &str) -> String
pub fn framed(&self, word: &str) -> String
__ig_<word>__ — a name in the SYNTHESIZED-COLUMN frame.
The shape a framework-invented FIELD or COLUMN wears: the mark in front and __ behind. Both
ends are load-bearing. The front is what a fence refuses a declared name for; the back is what
makes the join INJECTIVE, since the word is then everything between two fixed strings and two
words cannot reach one name.
A word whose tail looks like _<digits>__ is the one shape this cannot carry — that is the
alias mint’s own tail, and a framed word ending in one would be reachable by a join as well.
Where a mint is indexed the digits FUSE into the word (__ig_ord0__, never __ig_ord_0__).
Sourcepub fn framed_ident(&self, word: &str) -> Ident
pub fn framed_ident(&self, word: &str) -> Ident
framed as an identifier, for the fields and items an expansion writes.
§It cannot be spanned here
The call site sets the span, because a framework-minted name has no source to point at and the
span a diagnostic wants is the DECLARATION’s. Every caller today takes Span::call_site,
which is what format_ident! gives.
Sourcepub fn prefixed(&self, word: &str) -> String
pub fn prefixed(&self, word: &str) -> String
__ig_<word> — a name in the namespace but OUTSIDE the frame.
The shape for a minted ITEM rather than a column: a marker const, a DDL object, an audit function. It wears no tail because there is nothing to keep injective — such a name already ends in a word this crate chose, and the frame is the COLUMN law rather than the namespace’s.
Sourcepub fn prefixed_ident(&self, word: &str) -> Ident
pub fn prefixed_ident(&self, word: &str) -> Ident
prefixed as an identifier, spanned at the call site for
framed_ident’s reason.
Sourcepub fn refused(mark: &str) -> Option<String>
pub fn refused(mark: &str) -> Option<String>
Why this mark cannot be a namespace, or None where it can.
§The rules are the MINT’s, which is why they live beside it rather than in a front end
A mark is spent in three shapes — a framed column, a prefixed item, and a clamped SQL alias — and what it must be is decided by what those spend it as. A second copy of these rules in whichever crate happens to read the configuration is the copy that drifts the day a mint’s shape moves. What a front end adds is the SPAN: this answers in prose and knows nothing about tokens.
The byte BUDGET is deliberately not here. It is a fact about the alias mint alone — how much
of a table’s own name survives PostgreSQL’s sixty-three — and it depends on a depth this seat
has never heard of; crate::alias::refused is where the pair is held together.