pub enum Substitute {
TypeDefault(Produced),
Ours(Produced),
NoValue,
FromSiblings,
}Expand description
What this crate’s reader hands back where the engine’s answer names no value.
This crate’s answer, not the engine’s. Recording it stops a reader
inventing a number in an unwrap_or beside an entry that says no value is
known, which is how twelve non-obvious literals came to sit in readers with
nothing recording them.
Variants§
TypeDefault(Produced)
The field’s Rust type decided, so a rebuild regenerates it.
Carries the value anyway. A consumer that can name the state but not the value has only “the type decides” to print, which is a cell with nothing in it.
Ours(Produced)
A specific value this layer chose. Not an engine fact.
NoValue
There is nothing to substitute: the model holds the absence itself, so a reader hands back “not there” rather than a stand-in.
FromSiblings
The reader works it out from sibling fields, and this deliberately does not model how.
Silence::NotAConstant refuses the same thing on the engine’s side,
for the same reason: encoding a derivation would put a small expression
language in a static table to serve a handful of fields. Three entries
need it. The derivation lives in the view’s own reader, where it can be
read as code.
Trait Implementations§
Source§impl Clone for Substitute
impl Clone for Substitute
Source§fn clone(&self) -> Substitute
fn clone(&self) -> Substitute
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Substitute
impl Debug for Substitute
Source§impl PartialEq for Substitute
impl PartialEq for Substitute
Source§fn eq(&self, other: &Substitute) -> bool
fn eq(&self, other: &Substitute) -> bool
self and other values to be equal, and is used by ==.