pub enum BinValue {
Flag(bool),
Config(BinConfig),
}Expand description
"bin": true | {"maxbins": N} | {"step": w}. false is accepted and
means absent (Vega-Lite emits it; rejecting would be noise). Numbers stay
permissive (f64) so preflight can TEACH — serde must not bounce
maxbins: 0 with a generic type error before validation can explain it.
Variants§
Trait Implementations§
impl Copy for BinValue
Source§impl<'de> Deserialize<'de> for BinValue
A hand-written Deserialize instead of #[serde(untagged)]: untagged
buffers the value and, on failure, collapses to a generic “data did not
match any variant” — swallowing BinConfig’s precise unknown-field message.
Delegating the map form to BinConfig preserves “unknown field extent,
expected maxbins or step” (the codebase-wide deny_unknown_fields
contract) and rejects a bare number/string with a clear expecting line —
so {"bin": {"extent": [0,1]}} and {"bin": 3} both fail AT the bin value,
never silently matching Flag.
impl<'de> Deserialize<'de> for BinValue
A hand-written Deserialize instead of #[serde(untagged)]: untagged
buffers the value and, on failure, collapses to a generic “data did not
match any variant” — swallowing BinConfig’s precise unknown-field message.
Delegating the map form to BinConfig preserves “unknown field extent,
expected maxbins or step” (the codebase-wide deny_unknown_fields
contract) and rejects a bare number/string with a clear expecting line —
so {"bin": {"extent": [0,1]}} and {"bin": 3} both fail AT the bin value,
never silently matching Flag.