pub enum LineEntry {
Id(String),
Item(LineEntryItem),
}Expand description
One entry in [line].segments. Per ADR-0024, the array is a
mixed shape: bare strings ("model") round-trip as
LineEntry::Id for backward compatibility with the v0.x string-
only schema; inline tables ({ type = "separator", character = " | " })
round-trip as LineEntry::Item and carry per-boundary settings.
Untagged because the strict-tagged form would reject the bare-string
shorthand at parse time. Typo’d keys inside an inline table (e.g.
{ tpye = "separator" }) land in LineEntryItem::extra
rather than failing parse, preserving the spec’s “unknown keys
warn, never fail” contract. The runtime builder warns when a
kindless inline table reaches it; per-key typo diagnostics
inside [line].segments array entries are not yet surfaced
at config-load time (the existing validate_keys pass walks
only top-level / [layout_options] / [segments.<id>] shapes).
Variants§
Id(String)
Bare string: "model" is equivalent to { type = "model" }.
Item(LineEntryItem)
Inline table: { type = "...", ... }. Carries the kind tag
plus optional per-entry knobs (separator glyph, merge flag,
future ccstatusline-parity fields under LineEntryItem::extra).
Implementations§
Source§impl LineEntry
impl LineEntry
Sourcepub fn kind(&self) -> Option<&str>
pub fn kind(&self) -> Option<&str>
The entry’s type tag — segment id, "separator", or None
for a malformed inline table missing type. The builder
warns and drops None entries.
Sourcepub fn is_separator(&self) -> bool
pub fn is_separator(&self) -> bool
true when the entry is type = "separator". Bare strings
are never separators; an inline table without a type field
is also not classified as a separator (the builder drops it).
Sourcepub fn segment_id(&self) -> Option<&str>
pub fn segment_id(&self) -> Option<&str>
The segment id, or None for separators / kindless entries.
Sourcepub fn separator_character(&self) -> Option<&str>
pub fn separator_character(&self) -> Option<&str>
The separator-glyph override on a type = "separator" entry,
or None when the entry uses the global default. Always
None for non-separator entries.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LineEntry
impl<'de> Deserialize<'de> for LineEntry
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 LineEntry
impl JsonSchema for LineEntry
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