pub struct LineConfig {
pub segments: Vec<LineEntry>,
pub numbered: BTreeMap<String, Value>,
}Expand description
[line] section: ordered list of segment ids to render in
single-line mode, plus any numbered child tables ([line.1],
[line.2], …) for multi-line mode. The flatten-captured
numbered map carries every other key as a
raw toml::Value. Key validation (positive integer pointing
at a table with a segments array) and ordering happen in the
segment builder, which keeps the spec’s “unknown keys are
warnings, not errors” forward-compat contract: a typo like
[line] segmnts = [...] parses as a toml::Value::Array,
reaches the builder, and emits a warning rather than failing the
config load. Per spec docs/specs/config.md §Multi-line layouts.
Fields§
§segments: Vec<LineEntry>Custom deserializer routes each entry through try_into per-
item so a single malformed inline-table (e.g.
{ type = 42 }) doesn’t abort the whole Config::from_str
— it surfaces as a kindless LineEntry::Item that the
builder warns and drops. Mirrors the per-item warn-and-drop
behavior the numbered-line path already had via
crate::segments::builder’s extract_line_segments. Without
this, single-line configs with one bad boundary override
fail to load entirely while multi-line configs degrade
gracefully — an asymmetry users hit when porting between
layouts.
numbered: BTreeMap<String, Value>Anything under [line] other than segments. Holds
[line.N] table values plus any forward-compat scalar keys
future versions may add. The builder routes table values
with positive-integer keys to multi-line rendering and warns
on the rest.
Schema bypass: toml::Value has no JsonSchema impl, so
remap to serde_json::Value’s open-ended schema (any JSON
type) for the additionalProperties fallthrough.
Trait Implementations§
Source§impl Clone for LineConfig
impl Clone for LineConfig
Source§fn clone(&self) -> LineConfig
fn clone(&self) -> LineConfig
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 LineConfig
impl Debug for LineConfig
Source§impl Default for LineConfig
impl Default for LineConfig
Source§fn default() -> LineConfig
fn default() -> LineConfig
Source§impl<'de> Deserialize<'de> for LineConfigwhere
LineConfig: Default,
impl<'de> Deserialize<'de> for LineConfigwhere
LineConfig: Default,
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 LineConfig
impl JsonSchema for LineConfig
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 moreSource§impl PartialEq for LineConfig
impl PartialEq for LineConfig
Source§fn eq(&self, other: &LineConfig) -> bool
fn eq(&self, other: &LineConfig) -> bool
self and other values to be equal, and is used by ==.