#[non_exhaustive]pub struct Line {
pub kind: LineKind,
pub containers: Vec<Container>,
pub continues: bool,
}Expand description
A line’s attributes: its block role plus the container path it sits in.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: LineKind§containers: Vec<Container>Ancestor containers, outermost first. A multi-paragraph list item is two
Para lines sharing one [ListItem] path; a paragraph in a quote in a
list item is [ListItem, Quote].
continues: boolWhether this line continues the previous line’s block across a hard
line break (no paragraph break between), rather than starting a new
block. false = a new block (paragraph spacing on either side); true =
a within-block line break (markdown hard break; consecutive lines of one
code fence). The first line is always false. This is what keeps a hard
break (backend #linebreak()) distinct from a paragraph boundary through
the freeze, and what groups a code fence’s lines without an
adjacency heuristic.
Implementations§
Source§impl Line
impl Line
Sourcepub fn new(kind: LineKind) -> Self
pub fn new(kind: LineKind) -> Self
A line of kind at the top level: no containers, starting a new block.
Both defaults are what the wire reads off an absent key (containers
empty, continues omitted); set either with
with_containers /
with_continues.
Sourcepub fn with_containers(self, containers: Vec<Container>) -> Self
pub fn with_containers(self, containers: Vec<Container>) -> Self
Set containers, the ancestor path, outermost first.
Sourcepub fn with_continues(self, continues: bool) -> Self
pub fn with_continues(self, continues: bool) -> Self
Set continues: true makes this line a within-block
break off the previous one rather than a new block.