pub struct XdgDirectories { /* private fields */ }Expand description
Provides access to XDG Base Directory compliant paths for TSK
Implementations§
Source§impl XdgDirectories
impl XdgDirectories
Sourcepub fn new_with_paths(
data_dir: PathBuf,
runtime_dir: PathBuf,
config_dir: PathBuf,
_cache_dir: PathBuf,
) -> Self
pub fn new_with_paths( data_dir: PathBuf, runtime_dir: PathBuf, config_dir: PathBuf, _cache_dir: PathBuf, ) -> Self
Create new XDG directories with custom paths (for testing)
Sourcepub fn runtime_dir(&self) -> &Path
pub fn runtime_dir(&self) -> &Path
Get the runtime directory path (for sockets, pid files)
Sourcepub fn config_dir(&self) -> &Path
pub fn config_dir(&self) -> &Path
Get the config directory path (for configuration files)
Sourcepub fn templates_dir(&self) -> PathBuf
pub fn templates_dir(&self) -> PathBuf
Get the templates directory path
Sourcepub fn tasks_file(&self) -> PathBuf
pub fn tasks_file(&self) -> PathBuf
Get the path to the tasks.json file
Sourcepub fn task_dir(&self, task_id: &str, repo_hash: &str) -> PathBuf
pub fn task_dir(&self, task_id: &str, repo_hash: &str) -> PathBuf
Get the path to a task’s directory
Sourcepub fn socket_path(&self) -> PathBuf
pub fn socket_path(&self) -> PathBuf
Get the server socket path
Sourcepub fn ensure_directories(&self) -> Result<(), XdgError>
pub fn ensure_directories(&self) -> Result<(), XdgError>
Ensure all required directories exist
Trait Implementations§
Source§impl Clone for XdgDirectories
impl Clone for XdgDirectories
Source§fn clone(&self) -> XdgDirectories
fn clone(&self) -> XdgDirectories
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for XdgDirectories
impl RefUnwindSafe for XdgDirectories
impl Send for XdgDirectories
impl Sync for XdgDirectories
impl Unpin for XdgDirectories
impl UnwindSafe for XdgDirectories
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