pub struct HeadingLine {
pub level: usize,
pub status: Option<HeadingToken<TaskType>>,
pub priority: Option<HeadingToken<Priority>>,
pub title_start: usize,
}Expand description
A heading line as it sits in a file, located token by token.
This is the read half of an editing operation and the reason it lives here rather than in the editor: the keyword and cookie grammars are the ones the extractor itself applies, and a second copy of them would drift. Writing — assembling a line back from parts — is deliberately not part of this crate.
Unlike Task, which carries the heading the agenda displays, nothing is
summarised here. A heading may hold text between the keyword and the cookie
(# TODO leftover [#B] Title): the agenda keeps that text and shows the
cookie inside it, and title_start points at the text rather than past
the cookie, so an editor rewriting the title neither swallows the cookie
nor moves it. Replacing the cookie itself is what priority is for — its
range addresses the cookie where the user wrote it.
Fields§
§level: usizeHeading level, i.e. the number of leading # characters (1 to 6).
status: Option<HeadingToken<TaskType>>The TODO / DONE / CANCELLED / CANCELED keyword, when present.
priority: Option<HeadingToken<Priority>>The [#A] priority cookie, when present and within the accepted range.
title_start: usizeByte offset the title starts at, past the tokens above and the whitespace after them. Also where a caller inserts a token the heading does not carry yet. A cookie away from its canonical place counts as part of the title, so the offset stops before it.
Trait Implementations§
Source§impl Clone for HeadingLine
impl Clone for HeadingLine
Source§fn clone(&self) -> HeadingLine
fn clone(&self) -> HeadingLine
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more