pub struct Storage { /* private fields */ }Expand description
File-based storage for SCUD tasks
Implementations§
Source§impl Storage
impl Storage
pub fn new(project_root: Option<PathBuf>) -> Self
Sourcepub fn project_root(&self) -> &Path
pub fn project_root(&self) -> &Path
Get the project root directory
pub fn scud_dir(&self) -> PathBuf
Sourcepub fn tasks_file(&self) -> PathBuf
pub fn tasks_file(&self) -> PathBuf
Get the path to the tasks file
pub fn is_initialized(&self) -> bool
Sourcepub fn initialize_dirs(&self) -> Result<()>
pub fn initialize_dirs(&self) -> Result<()>
Initialize storage directories (minimal version without config)
pub fn load_tasks(&self) -> Result<HashMap<String, Phase>>
pub fn save_tasks(&self, tasks: &HashMap<String, Phase>) -> Result<()>
pub fn get_active_group(&self) -> Result<Option<String>>
pub fn set_active_group(&self, group_tag: &str) -> Result<()>
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear the active group cache Useful when active-tag file is modified externally or for testing
Sourcepub fn clear_active_group(&self) -> Result<()>
pub fn clear_active_group(&self) -> Result<()>
Clear the active group setting (remove the active-tag file)
Sourcepub fn load_group(&self, group_tag: &str) -> Result<Phase>
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
Sourcepub fn load_active_group(&self) -> Result<Phase>
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
Sourcepub fn update_group(&self, group_tag: &str, group: &Phase) -> Result<()>
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
Sourcepub fn update_task_status(
&self,
group_tag: &str,
task_id: &str,
status: TaskStatus,
) -> Result<()>
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
pub fn read_file(&self, path: &Path) -> Result<String>
Auto Trait Implementations§
impl !Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnsafeUnpin for Storage
impl UnwindSafe for Storage
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
Mutably borrows from an owned value. Read more