Skip to main content

Report

Struct Report 

Source
pub struct Report {
    pub total: Duration,
    pub rows: Vec<ReportRow>,
    pub columns: Vec<String>,
    pub column_totals: Vec<Duration>,
    pub timeline: Vec<Slot>,
}
Expand description

A computed report, rendered both in the desktop app and as markdown (export).

Fields§

§total: Duration

Time worked, by the clock: when tasks ran at once (an agent’s subagents, say) that time counts once, so task rows can add up to more, and tag rows too (a task with several tags counts under each).

§rows: Vec<ReportRow>

Tasks (or tags) with tracked time, busiest first.

§columns: Vec<String>

Breakdown column labels (days of a week, weeks of a month); empty for hour/day.

§column_totals: Vec<Duration>

Time worked in each breakdown column, counted like total.

§timeline: Vec<Slot>

Every session in the period, in start order.

Implementations§

Source§

impl Report

Source

pub fn timeline_with_gaps( &self, now: DateTime<Local>, ) -> Vec<(Option<Duration>, &Slot)>

Each timeline slot with the untracked gap (if long enough) right before it.

Source§

impl Report

Source

pub fn merge(parts: Vec<(Option<String>, Report)>, view: &ReportView) -> Report

Several brains’ reports for the same view as one, worked out again from their sessions so time tasks of different brains ran at once counts once too. Task rows and timeline entries are named after their brain (api · #3 Fix login), since each brain numbers its entries from 1.

Trait Implementations§

Source§

impl Debug for Report

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.