pub struct ScannedExcerpt {
pub line: u32,
pub end_line: u32,
pub group: String,
pub label: String,
pub sort_key: i64,
pub spans: Vec<RowSpan>,
pub annotation: Option<RowAnnotation>,
pub emphasis: bool,
}Expand description
One agenda row a producer found in a file.
The native mirror of the WIT entry (wit/scanned-excerpt-source.wit). It is a
span in a file, not a rendered string, because the agenda is literally a
multibuffer of excerpts — which is what buys jump-to-source and
edit-propagates-to-source for free (org-mode.md §6.1).
Fields§
§line: u320-based first line of the row’s excerpt.
end_line: u320-based last line of the excerpt, inclusive. Equal to line for the
one-row-per-headline case.
group: StringGrouping key. Rows that sort adjacently and share a key render under one header. A key rather than a label because a producer cannot know which of its rows lands first once other files’ rows are interleaved — the host compares keys after the sort.
label: StringThe header title, used when this row turns out to start a group.
sort_key: i64The host stable-sorts every file’s rows together on this, ascending. The producer owns what it means.
spans: Vec<RowSpan>How this row is coloured, as byte spans into the row’s own first line — NOT into the composed view, which the producer cannot see until every other file’s rows have been interleaved by the sort (OA.5).
Empty is the ordinary case, and means “say nothing about colour”: the source file’s own grammar highlighting is what shows, unchanged. A producer fills this when the row has semantics its grammar does not carry — an agenda’s TODO keyword, priority and tags are org’s, not the org grammar’s, which is why an agenda looked like org text out of order before this existed.
annotation: Option<RowAnnotation>A row to hang BELOW this one, or None (HB.5).
The WIT annotation, native side. A row’s text is a verbatim excerpt of
a source line, so a producer with something of its own to show — a
habit’s consistency graph — has nowhere to put it; this becomes a
virtual row anchored below instead.
None is the ordinary case. A scan of plain TODOs grows no second rows.
emphasis: boolMH.A6: render this row’s header EMPHASISED, when it turns out to start a group.
Read only on the row that starts the group — the same rule
label already lives by, and for the same reason: a
producer cannot know which of its rows lands first after the sort, so
it sets the field on every row of the group and the host reads whichever
one wins. Setting it inconsistently across a group is a producer bug
that shows as “sometimes emphasised”.
false is the ordinary case and leaves the header byte-identical to
before this field existed.
Trait Implementations§
Source§impl Clone for ScannedExcerpt
impl Clone for ScannedExcerpt
Source§fn clone(&self) -> ScannedExcerpt
fn clone(&self) -> ScannedExcerpt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScannedExcerpt
impl Debug for ScannedExcerpt
impl Eq for ScannedExcerpt
Source§impl PartialEq for ScannedExcerpt
impl PartialEq for ScannedExcerpt
impl StructuralPartialEq for ScannedExcerpt
Auto Trait Implementations§
impl Freeze for ScannedExcerpt
impl RefUnwindSafe for ScannedExcerpt
impl Send for ScannedExcerpt
impl Sync for ScannedExcerpt
impl Unpin for ScannedExcerpt
impl UnsafeUnpin for ScannedExcerpt
impl UnwindSafe for ScannedExcerpt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.