Skip to main content

Storage

Struct Storage 

Source
pub struct Storage { /* private fields */ }
Expand description

File-based storage for SCUD tasks

Implementations§

Source§

impl Storage

Source

pub fn new(project_root: Option<PathBuf>) -> Self

Source

pub fn project_root(&self) -> &Path

Get the project root directory

Source

pub fn scud_dir(&self) -> PathBuf

Source

pub fn tasks_file(&self) -> PathBuf

Get the path to the tasks file

Source

pub fn is_initialized(&self) -> bool

Source

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

Initialize storage directories (minimal version without config)

Source

pub fn load_tasks(&self) -> Result<HashMap<String, Phase>>

Source

pub fn save_tasks(&self, tasks: &HashMap<String, Phase>) -> Result<()>

Source

pub fn get_active_group(&self) -> Result<Option<String>>

Source

pub fn set_active_group(&self, group_tag: &str) -> Result<()>

Source

pub fn clear_cache(&self)

Clear the active group cache Useful when active-tag file is modified externally or for testing

Source

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

Clear the active group setting (remove the active-tag file)

Source

pub fn load_group(&self, group_tag: &str) -> Result<Phase>

Load a single task group by tag Parses the SCG file and extracts the requested group

Source

pub fn load_active_group(&self) -> Result<Phase>

Load the active task group directly (optimized) Combines get_active_group() and load_group() in one call

Source

pub fn update_group(&self, group_tag: &str, group: &Phase) -> Result<()>

Update a single task group atomically Holds exclusive lock across read-modify-write cycle to prevent races

Source

pub fn update_task_status( &self, group_tag: &str, task_id: &str, status: TaskStatus, ) -> Result<()>

Update a single task’s status within a group Convenience method that loads, modifies, and saves the group atomically

Source

pub fn read_file(&self, path: &Path) -> Result<String>

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.