pub struct FileSystemManager { /* private fields */ }
Expand description
Manages file system operations for project directories
Implementations§
Source§impl FileSystemManager
impl FileSystemManager
Sourcepub fn project_dir(&self, project_name: &str) -> PathBuf
pub fn project_dir(&self, project_name: &str) -> PathBuf
Get the project directory path
Sourcepub fn project_info_dir(&self, project_name: &str) -> PathBuf
pub fn project_info_dir(&self, project_name: &str) -> PathBuf
Get the project info directory path (tech-stack.md, vision.md)
Sourcepub fn specs_dir(&self, project_name: &str) -> PathBuf
pub fn specs_dir(&self, project_name: &str) -> PathBuf
Get the specifications directory path for a project
Sourcepub fn spec_dir(&self, project_name: &str, spec_id: &str) -> PathBuf
pub fn spec_dir(&self, project_name: &str, spec_id: &str) -> PathBuf
Get the specification directory path
Sourcepub fn ensure_base_dir(&self) -> Result<()>
pub fn ensure_base_dir(&self) -> Result<()>
Create the base directory structure if it doesn’t exist
Sourcepub fn create_project_structure(&self, project_name: &str) -> Result<()>
pub fn create_project_structure(&self, project_name: &str) -> Result<()>
Create the complete project directory structure
Sourcepub fn create_spec_structure(
&self,
project_name: &str,
spec_id: &str,
) -> Result<()>
pub fn create_spec_structure( &self, project_name: &str, spec_id: &str, ) -> Result<()>
Create specification directory structure
Sourcepub fn project_exists(&self, project_name: &str) -> bool
pub fn project_exists(&self, project_name: &str) -> bool
Check if a project exists
Sourcepub fn spec_exists(&self, project_name: &str, spec_id: &str) -> bool
pub fn spec_exists(&self, project_name: &str, spec_id: &str) -> bool
Check if a specification exists
Sourcepub fn list_projects(&self) -> Result<Vec<String>>
pub fn list_projects(&self) -> Result<Vec<String>>
List all projects
Sourcepub fn list_specs(&self, project_name: &str) -> Result<Vec<String>>
pub fn list_specs(&self, project_name: &str) -> Result<Vec<String>>
List specifications for a project
Sourcepub fn write_file_safe(&self, file_path: &Path, content: &str) -> Result<()>
pub fn write_file_safe(&self, file_path: &Path, content: &str) -> Result<()>
Write content to a file with atomic operation and backup
Sourcepub fn file_exists(&self, file_path: &Path) -> bool
pub fn file_exists(&self, file_path: &Path) -> bool
Check if a file exists
Sourcepub fn get_file_modified_time(&self, file_path: &Path) -> Result<SystemTime>
pub fn get_file_modified_time(&self, file_path: &Path) -> Result<SystemTime>
Get file modification time
Sourcepub fn cleanup_old_files(&self, max_age_seconds: u64) -> Result<()>
pub fn cleanup_old_files(&self, max_age_seconds: u64) -> Result<()>
Clean up temporary and backup files older than specified age
Trait Implementations§
Source§impl Clone for FileSystemManager
impl Clone for FileSystemManager
Source§fn clone(&self) -> FileSystemManager
fn clone(&self) -> FileSystemManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for FileSystemManager
impl RefUnwindSafe for FileSystemManager
impl Send for FileSystemManager
impl Sync for FileSystemManager
impl Unpin for FileSystemManager
impl UnwindSafe for FileSystemManager
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