pub enum Horizon {
Name(HorizonBase),
Spec(HorizonSpec),
}Expand description
A scenic horizon (spec-0026). A horizon is a composition of orthogonal
axes, not an enum of monoliths: a base — what surrounds the map — and
that base’s params. The field accepts a plain string shorthand
([HorizonName]) or the object form HorizonSpec {base, …params}.
Consumers never match this wire enum. Horizon::resolved desugars both
forms into one ResolvedHorizon with the pinned defaults applied, and
horizon_base answers the one question most callers have.
Variants§
Name(HorizonBase)
A bare base name — "ocean" is exactly {base: "ocean"}. The two
bases that predate the horizon library were spelled this way and still
are, byte-identically; a base added since is spellable this way too,
because a base with every param at its default has nothing else to say.
Spec(HorizonSpec)
The object form {base, …params}.
Implementations§
Source§impl Horizon
impl Horizon
Sourcepub fn resolved(&self) -> ResolvedHorizon
pub fn resolved(&self) -> ResolvedHorizon
Desugar either wire form to the one resolved view, defaults applied.
Sourcepub fn base(&self) -> HorizonBase
pub fn base(&self) -> HorizonBase
The resolved base.
Sourcepub fn needs_horizon_library(&self) -> bool
pub fn needs_horizon_library(&self) -> bool
True when this declaration needs the horizon-library surface: the object form, or a bare name for a base that did not exist before it.
The two bases that predate the library stay writable as bare names at the version that introduced them, and their emission does not move — which is what makes this a widening rather than a break. What is fenced is saying something the old surface had no spelling for.
Trait Implementations§
impl Copy for Horizon
Source§impl<'de> Deserialize<'de> for Horizon
impl<'de> Deserialize<'de> for Horizon
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Horizon
impl JsonSchema for Horizon
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more