TaskSet

Struct TaskSet 

Source
pub struct TaskSet { /* private fields */ }

Implementations§

Source§

impl TaskSet

Source

pub fn display_by_next(&mut self, ctx: &Query, truncate: bool) -> Result<()>

Displays tasks in “next” view (by priority and creation date)

Source

pub fn render_json(&self) -> Result<()>

Renders tasks as JSON

Source

pub fn render_table(&self, truncate: bool) -> Result<()>

Renders tasks as a table

Source

pub fn display_by_week(&mut self) -> Result<()>

Displays tasks grouped by week (for show-resolved)

Source

pub fn display_projects(&self) -> Result<()>

Displays projects

Source§

impl TaskSet

Source

pub fn new(repo_path: PathBuf, ids_file_path: PathBuf) -> Self

Source

pub fn load( repo_path: &Path, ids_file_path: &Path, include_resolved: bool, ) -> Result<Self>

Loads tasks from the repository

Source

pub fn load_task(&mut self, task: Task) -> Result<()>

Loads a task into the set

Source

pub fn assign_ids(&mut self) -> Result<()>

Assigns IDs to tasks

Source

pub fn filter(&mut self, query: &Query)

Filters tasks by a query

Source

pub fn tasks(&self) -> Vec<&Task>

Returns unfiltered tasks only

Source

pub fn all_tasks(&self) -> &[Task]

Returns all tasks regardless of filtered status

Source

pub fn tasks_mut(&mut self) -> &mut Vec<Task>

Returns mutable reference to tasks

Source

pub fn save_pending_changes(&mut self) -> Result<()>

Saves all pending changes

Source

pub fn get_by_id(&self, id: i32) -> Option<&Task>

Gets a task by ID

Source

pub fn get_by_id_mut(&mut self, id: i32) -> Option<&mut Task>

Gets a mutable task by ID

Source

pub fn get_by_uuid(&self, uuid: &str) -> Option<&Task>

Gets a task by UUID

Source

pub fn update_task(&mut self, task: Task) -> Result<()>

Updates an existing task

Source

pub fn sort_by_created_ascending(&mut self)

Sorts tasks by creation date (then by ID for stability)

Source

pub fn sort_by_created_descending(&mut self)

Source

pub fn sort_by_priority_ascending(&mut self)

Sorts tasks by priority (P0 > P1 > P2 > P3)

Source

pub fn sort_by_priority_descending(&mut self)

Source

pub fn sort_by_resolved_ascending(&mut self)

Sorts tasks by resolved date

Source

pub fn sort_by_resolved_descending(&mut self)

Source

pub fn filter_by_status(&mut self, status: &str)

Filters to show only specified status

Source

pub fn filter_organised(&mut self)

Filters to show only organized tasks (with tags or project)

Source

pub fn filter_unorganised(&mut self)

Filters to show only unorganized tasks

Source

pub fn unhide(&mut self)

Unhides tasks with hidden statuses

Source

pub fn get_tags(&self) -> Vec<String>

Gets all tags in use

Source

pub fn get_projects(&self) -> Vec<Project>

Gets all projects with statistics

Source

pub fn num_total(&self) -> usize

Returns the total number of tasks

Source

pub fn must_get_by_id(&self, id: i32) -> &Task

Gets a task by ID, panics if not found

Source

pub fn must_load_task(&mut self, task: Task) -> Result<Task>

Loads a task into the set, returns the loaded task, panics on error

Source

pub fn must_update_task(&mut self, task: Task) -> Result<()>

Updates a task, panics on error

Source

pub fn apply_modifications(&mut self, query: &Query) -> Result<()>

Apply modifications from a query to filtered tasks

Source

pub fn delete_task(&mut self, uuid: &str) -> Result<()>

Delete a task by UUID

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.