pub struct MappingEntry {
pub span: Span,
pub indent: usize,
pub key: ScalarParts,
pub value: Option<ScalarParts>,
pub block: Option<BlockScalar>,
pub opens_scope: bool,
pub children: Vec<Node>,
}Expand description
One key: … mapping entry line and, when the entry opens a scope, the
nodes nested below it.
Fields§
§span: SpanThe entry’s own line content (key start through line end).
indent: usizeEffective indent. Entries nested inline after a sequence dash use the
line model’s dash + 2 convention rather than the literal column.
key: ScalarPartsParsed mapping key, including any embedded template holes.
value: Option<ScalarParts>Inline (non-block) value text, when present.
block: Option<BlockScalar>Block-scalar header and suppressed body, for key: |-style entries.
opens_scope: boolWhether the entry opened a container scope (empty, template, or block-scalar value with a plain key). Closed or invalid-key entries never adopt children.
children: Vec<Node>Nodes structurally nested below the mapping entry.
Implementations§
Source§impl MappingEntry
impl MappingEntry
Sourcepub fn sequence_items(&self) -> Vec<&SequenceItem>
pub fn sequence_items(&self) -> Vec<&SequenceItem>
The sequence items nested below this entry in document order, looking
through control regions: an item closed while a branch was active is
owned by that branch, while an item still open when the region ended
escapes to the entry itself. Guard structure is dropped; use
children to keep it.