pub struct ClockReportProvider { /* private fields */ }Expand description
Renders a ClockReport as virtual rows above line 0 of a scan view.
Display-only, and that is the design (org-agenda.md §3): a clock report has
no source range and nothing to jump to, which is exactly what VirtualRow
models. The cost — you cannot put the cursor on a report line — is stated in
the design rather than discovered here; making those lines actionable means
excerpts over a synthetic pathless source, which is deferred.
Implementations§
Source§impl ClockReportProvider
impl ClockReportProvider
Sourcepub fn new(
view: BufferId,
state: Arc<RwLock<ScanViewState>>,
days: RangeInclusive<i64>,
) -> Self
pub fn new( view: BufferId, state: Arc<RwLock<ScanViewState>>, days: RangeInclusive<i64>, ) -> Self
Unthemed — the rows paint with the renderer’s default foreground.
Test convenience; production goes through Self::with_theme.
Sourcepub fn with_theme(
view: BufferId,
state: Arc<RwLock<ScanViewState>>,
days: RangeInclusive<i64>,
theme: ThemeRegistryHandle,
elements: ClockReportElementIds,
) -> Self
pub fn with_theme( view: BufferId, state: Arc<RwLock<ScanViewState>>, days: RangeInclusive<i64>, theme: ThemeRegistryHandle, elements: ClockReportElementIds, ) -> Self
The production constructor: colours resolve from the registry on every
collect(), and the resolved theme’s version rides in version(), so a
:colorscheme swap re-paints the report instead of leaving it in the
previous palette.
Sourcepub fn set_days(&self, days: RangeInclusive<i64>)
pub fn set_days(&self, days: RangeInclusive<i64>)
Re-point the report at a different range — what gD’s day/week/month
toggles change. Bumps the version so the rows rebuild.
Trait Implementations§
Source§impl Debug for ClockReportProvider
impl Debug for ClockReportProvider
Source§impl VirtualRowProvider for ClockReportProvider
impl VirtualRowProvider for ClockReportProvider
Source§fn id(&self) -> u64
fn id(&self) -> u64
Source§fn version(&self) -> u64
fn version(&self) -> u64
Self::collect] would emit have
changed. The worker uses the combined fingerprint of all
providers’ versions to short-circuit on the cache-hit
path without paying for the (potentially expensive)
collect calls. Read moreAuto Trait Implementations§
impl !Freeze for ClockReportProvider
impl !RefUnwindSafe for ClockReportProvider
impl !UnwindSafe for ClockReportProvider
impl Send for ClockReportProvider
impl Sync for ClockReportProvider
impl Unpin for ClockReportProvider
impl UnsafeUnpin for ClockReportProvider
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more