pub fn build_segments(
config: Option<&Config>,
plugins: Option<(PluginRegistry, Arc<Engine>)>,
warn: impl FnMut(&str),
) -> Vec<LineItem>Expand description
Build a segment list from an optional Config.
None or a config without a [line] section uses the default
order. warn receives a one-line diagnostic for each validation
rule triggered (pass |_| {} to discard).
plugins carries the discovered PluginRegistry plus its
shared engine. Built-in ids win on collision (the registry already
rejects plugins shadowing built-ins at load time, so a plugin
reaching this function can only collide with another plugin or
stand alone).
Implements the validation rules in docs/specs/config.md
§Validation rules: unknown ids skip with a warning, duplicates
keep the first, an explicit segments = [] warns, inverted width
bounds drop the override with a warning.
Single-line entry; multi-line callers should use build_lines.
When this function is invoked against a layout = "multi-line"
config, it returns line 1 (sorted by numbered key) and warns,
rather than reading the empty [line].segments field and
returning nothing. Without that fallback, embedders loading the
multi-line power-user preset would silently render a blank
status line.