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§
§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 rather than starting a new block. false = a new block
(paragraph spacing on either side); true = a within-block line break (a
markdown hard break; consecutive lines of one code fence). The first line
is always false, as is one whose container path differs from the line
above or whose block above renders a single line
(LineKind::takes_continuations).
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,
which is also what the wire reads off the absent keys.
Sourcepub fn with_containers(self, containers: Vec<Container>) -> Self
pub fn with_containers(self, containers: Vec<Container>) -> Self
Set 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.