pub struct View {}Expand description
A utility struct for rendering application data to the console.
Serves as a namespace for various table rendering functions. All methods are static, making it easy to call formatting functions without needing to instantiate the struct.
Implementations§
Source§impl View
impl View
Sourcepub fn tasks(tasks: &[Task]) -> Result<()>
pub fn tasks(tasks: &[Task]) -> Result<()>
Displays a formatted table of tasks with comprehensive metadata.
Renders a detailed table showing task information including identification numbers, names, completion status, comments, and associated tags.
Sourcepub fn report(
workday: &Workday,
intervals: &[WorkInterval],
filtered_duration: &TimeDelta,
productivity: &f64,
tasks: &[Task],
) -> Result<()>
pub fn report( workday: &Workday, intervals: &[WorkInterval], filtered_duration: &TimeDelta, productivity: &f64, tasks: &[Task], ) -> Result<()>
Displays a formatted daily work report using pre-calculated intervals.
Sourcepub fn sum(
(daily_durations, total_duration, average_duration): &(HashMap<NaiveDate, (String, String)>, String, String),
) -> Result<()>
pub fn sum( (daily_durations, total_duration, average_duration): &(HashMap<NaiveDate, (String, String)>, String, String), ) -> Result<()>
Displays a monthly summary of working hours with daily breakdowns.
§Examples
use kasl::libs::view::View;
use std::collections::HashMap;
let daily_map = HashMap::new();
let total_hours = String::new();
let average_hours = String::new();
let summary_data = (daily_map, total_hours, average_hours);
View::sum(&summary_data)?;Sourcepub fn pauses(pauses: &[Pause], total_pause_time: Duration) -> Result<()>
pub fn pauses(pauses: &[Pause], total_pause_time: Duration) -> Result<()>
Displays a table of pauses for a given day with total pause time.
Sourcepub fn templates(templates: &[TaskTemplate]) -> Result<()>
pub fn templates(templates: &[TaskTemplate]) -> Result<()>
Displays a formatted table of task templates for reusable task creation.
§Examples
use kasl::libs::view::View;
use kasl::db::templates::TaskTemplate;
let templates: Vec<TaskTemplate> = vec![/* template instances */];
View::templates(&templates)?;Displays a formatted table of tags for task categorization and organization.
§Examples
use kasl::libs::view::View;
use kasl::db::tags::Tag;
let tags: Vec<Tag> = vec![/* tag instances */];
View::tags(&tags)?;Sourcepub fn jira_inbox(items: &[JiraInboxItem]) -> Result<()>
pub fn jira_inbox(items: &[JiraInboxItem]) -> Result<()>
Displays active Jira inbox items (pinned, score, then priority).
SUMMARY is truncated to fit the terminal width (same approach as View::tasks).
The CHANGE column shows freshness badges: NEW, gone, or the latest
visible change such as status→In Progress.