pub struct Filesystem;Expand description
Provides filesystem operations for the Grimoire CSS system.
This struct implements methods for managing the file system structure required by Grimoire CSS, including configuration directories and files.
Implementations§
Source§impl Filesystem
impl Filesystem
Sourcepub fn get_config_path(current_dir: &Path) -> Result<PathBuf, GrimoireCssError>
pub fn get_config_path(current_dir: &Path) -> Result<PathBuf, GrimoireCssError>
Retrieves or creates the path for the configuration file.
This method ensures that the necessary directory structure exists and returns the path to the grimoire.config.json file.
§Arguments
current_dir- The base directory path to create the configuration in
§Returns
Returns a PathBuf pointing to the configuration file location
§Errors
Returns a GrimoireCSSError if:
- The directory structure cannot be created
- File system permissions prevent access
Sourcepub fn get_or_create_grimoire_path(
cwd: &Path,
) -> Result<PathBuf, GrimoireCssError>
pub fn get_or_create_grimoire_path( cwd: &Path, ) -> Result<PathBuf, GrimoireCssError>
Gets or creates the path for the GrimoireCSS folder.
This method ensures the existence of the Grimoire directory structure. If the directories don’t exist, it creates them and adds a success message to the notification buffer.
§Arguments
cwd- The current working directory where the Grimoire folder should be created
§Returns
Returns a PathBuf pointing to the Grimoire directory
§Errors
Returns a GrimoireCSSError if:
- Directory creation fails
- File system operations are not permitted
Auto Trait Implementations§
impl Freeze for Filesystem
impl RefUnwindSafe for Filesystem
impl Send for Filesystem
impl Sync for Filesystem
impl Unpin for Filesystem
impl UnwindSafe for Filesystem
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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