pub struct Storage { /* private fields */ }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
pub fn tasks_file(&self) -> PathBuf
pub fn config_file(&self) -> PathBuf
pub fn docs_dir(&self) -> PathBuf
pub fn guidance_dir(&self) -> PathBuf
Sourcepub fn load_guidance(&self) -> Result<String>
pub fn load_guidance(&self) -> Result<String>
Load all .md files from .scud/guidance/ folder Returns concatenated content with file headers, or empty string if no files
pub fn is_initialized(&self) -> bool
pub fn initialize(&self) -> Result<()>
pub fn initialize_with_config(&self, config: &Config) -> Result<()>
pub fn load_config(&self) -> Result<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>
Sourcepub fn archive_dir(&self) -> PathBuf
pub fn archive_dir(&self) -> PathBuf
Get the archive directory path
Sourcepub fn ensure_archive_dir(&self) -> Result<()>
pub fn ensure_archive_dir(&self) -> Result<()>
Ensure archive directory exists
Sourcepub fn archive_filename(&self, tag: Option<&str>) -> String
pub fn archive_filename(&self, tag: Option<&str>) -> String
Generate archive filename for a tag or all tasks Format: {YYYY-MM-DD}_{tag}.scg or {YYYY-MM-DD}_all.scg
Sourcepub fn archive_phase(
&self,
tag: &str,
phases: &HashMap<String, Phase>,
) -> Result<PathBuf>
pub fn archive_phase( &self, tag: &str, phases: &HashMap<String, Phase>, ) -> Result<PathBuf>
Archive a single phase/tag Returns the path to the created archive file
Sourcepub fn archive_all(&self, phases: &HashMap<String, Phase>) -> Result<PathBuf>
pub fn archive_all(&self, phases: &HashMap<String, Phase>) -> Result<PathBuf>
Archive all phases together Returns the path to the created archive file
Sourcepub fn parse_archive_filename(filename: &str) -> (String, Option<String>)
pub fn parse_archive_filename(filename: &str) -> (String, Option<String>)
Parse archive filename to extract date and tag Returns (date, tag) where tag is None if “all”
Sourcepub fn list_archives(&self) -> Result<Vec<ArchiveInfo>>
pub fn list_archives(&self) -> Result<Vec<ArchiveInfo>>
List all archives in the archive directory Returns sorted by date descending (newest first)
Sourcepub fn load_archive(&self, path: &Path) -> Result<HashMap<String, Phase>>
pub fn load_archive(&self, path: &Path) -> Result<HashMap<String, Phase>>
Load an archive file Returns the phases contained in the archive
Auto Trait Implementations§
impl !Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more