pub struct TaskSet { /* private fields */ }Implementations§
Source§impl TaskSet
impl TaskSet
Sourcepub fn display_by_next(&mut self, ctx: &Query, truncate: bool) -> Result<()>
pub fn display_by_next(&mut self, ctx: &Query, truncate: bool) -> Result<()>
Displays tasks in “next” view (by priority and creation date)
Sourcepub fn render_json(&self) -> Result<()>
pub fn render_json(&self) -> Result<()>
Renders tasks as JSON
Sourcepub fn render_table(&self, truncate: bool) -> Result<()>
pub fn render_table(&self, truncate: bool) -> Result<()>
Renders tasks as a table
Sourcepub fn display_by_week(&mut self) -> Result<()>
pub fn display_by_week(&mut self) -> Result<()>
Displays tasks grouped by week (for show-resolved)
Sourcepub fn display_projects(&self) -> Result<()>
pub fn display_projects(&self) -> Result<()>
Displays projects
Source§impl TaskSet
impl TaskSet
pub fn new(repo_path: PathBuf, ids_file_path: PathBuf) -> Self
Sourcepub fn load(
repo_path: &Path,
ids_file_path: &Path,
include_resolved: bool,
) -> Result<Self>
pub fn load( repo_path: &Path, ids_file_path: &Path, include_resolved: bool, ) -> Result<Self>
Loads tasks from the repository
Sourcepub fn assign_ids(&mut self) -> Result<()>
pub fn assign_ids(&mut self) -> Result<()>
Assigns IDs to tasks
Sourcepub fn save_pending_changes(&mut self) -> Result<()>
pub fn save_pending_changes(&mut self) -> Result<()>
Saves all pending changes
Sourcepub fn get_by_id_mut(&mut self, id: i32) -> Option<&mut Task>
pub fn get_by_id_mut(&mut self, id: i32) -> Option<&mut Task>
Gets a mutable task by ID
Sourcepub fn get_by_uuid(&self, uuid: &str) -> Option<&Task>
pub fn get_by_uuid(&self, uuid: &str) -> Option<&Task>
Gets a task by UUID
Sourcepub fn update_task(&mut self, task: Task) -> Result<()>
pub fn update_task(&mut self, task: Task) -> Result<()>
Updates an existing task
Sourcepub fn sort_by_created_ascending(&mut self)
pub fn sort_by_created_ascending(&mut self)
Sorts tasks by creation date (then by ID for stability)
pub fn sort_by_created_descending(&mut self)
Sourcepub fn sort_by_priority_ascending(&mut self)
pub fn sort_by_priority_ascending(&mut self)
Sorts tasks by priority (P0 > P1 > P2 > P3)
pub fn sort_by_priority_descending(&mut self)
Sourcepub fn sort_by_resolved_ascending(&mut self)
pub fn sort_by_resolved_ascending(&mut self)
Sorts tasks by resolved date
pub fn sort_by_resolved_descending(&mut self)
Sourcepub fn filter_by_status(&mut self, status: &str)
pub fn filter_by_status(&mut self, status: &str)
Filters to show only specified status
Sourcepub fn filter_organised(&mut self)
pub fn filter_organised(&mut self)
Filters to show only organized tasks (with tags or project)
Sourcepub fn filter_unorganised(&mut self)
pub fn filter_unorganised(&mut self)
Filters to show only unorganized tasks
Gets all tags in use
Sourcepub fn get_projects(&self) -> Vec<Project>
pub fn get_projects(&self) -> Vec<Project>
Gets all projects with statistics
Sourcepub fn must_get_by_id(&self, id: i32) -> &Task
pub fn must_get_by_id(&self, id: i32) -> &Task
Gets a task by ID, panics if not found
Sourcepub fn must_load_task(&mut self, task: Task) -> Result<Task>
pub fn must_load_task(&mut self, task: Task) -> Result<Task>
Loads a task into the set, returns the loaded task, panics on error
Sourcepub fn must_update_task(&mut self, task: Task) -> Result<()>
pub fn must_update_task(&mut self, task: Task) -> Result<()>
Updates a task, panics on error
Sourcepub fn apply_modifications(&mut self, query: &Query) -> Result<()>
pub fn apply_modifications(&mut self, query: &Query) -> Result<()>
Apply modifications from a query to filtered tasks
Sourcepub fn delete_task(&mut self, uuid: &str) -> Result<()>
pub fn delete_task(&mut self, uuid: &str) -> Result<()>
Delete a task by UUID
Auto Trait Implementations§
impl Freeze for TaskSet
impl RefUnwindSafe for TaskSet
impl Send for TaskSet
impl Sync for TaskSet
impl Unpin for TaskSet
impl UnsafeUnpin for TaskSet
impl UnwindSafe for TaskSet
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> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);