Struct cap_directories::ProjectDirs
source · pub struct ProjectDirs { /* private fields */ }
Expand description
ProjectDirs
computes the cache, config or data directories for a specific
application, which are derived from the standard directories and the name
of the project/organization.
This corresponds to directories_next::ProjectDirs
, except that the
functions create the directories if they don’t exist, open them, and return
Dir
s instead of returning Path
s.
Unlike directories_next::ProjectDirs
, this API has no
ProjectDirs::from_path
, ProjectDirs::path
or
ProjectDirs::project_path
, and the *_dir
functions return Dir
s rather
than Path
s, because absolute paths don’t interoperate well with the
capability model.
Implementations§
source§impl ProjectDirs
impl ProjectDirs
sourcepub fn from(
qualifier: &str,
organization: &str,
application: &str,
ambient_authority: AmbientAuthority,
) -> Option<Self>
pub fn from( qualifier: &str, organization: &str, application: &str, ambient_authority: AmbientAuthority, ) -> Option<Self>
Creates a ProjectDirs
struct from values describing the project.
This corresponds to directories_next::ProjectDirs::from
.
§Ambient Authority
This function makes use of ambient authority to access the project directories.
sourcepub fn cache_dir(&self) -> Result<Dir>
pub fn cache_dir(&self) -> Result<Dir>
Returns the project’s cache directory.
This corresponds to directories_next::ProjectDirs::cache_dir
.
sourcepub fn config_dir(&self) -> Result<Dir>
pub fn config_dir(&self) -> Result<Dir>
Returns the project’s config directory.
This corresponds to directories_next::ProjectDirs::config_dir
.
sourcepub fn data_dir(&self) -> Result<Dir>
pub fn data_dir(&self) -> Result<Dir>
Returns the project’s data directory.
This corresponds to directories_next::ProjectDirs::data_dir
.
sourcepub fn data_local_dir(&self) -> Result<Dir>
pub fn data_local_dir(&self) -> Result<Dir>
Returns the project’s local data directory.
This corresponds to directories_next::ProjectDirs::data_local_dir
.
sourcepub fn runtime_dir(&self) -> Result<Dir>
pub fn runtime_dir(&self) -> Result<Dir>
Returns the project’s runtime directory.
This corresponds to directories_next::ProjectDirs::runtime_dir
.
Trait Implementations§
source§impl Clone for ProjectDirs
impl Clone for ProjectDirs
source§fn clone(&self) -> ProjectDirs
fn clone(&self) -> ProjectDirs
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for ProjectDirs
impl RefUnwindSafe for ProjectDirs
impl Send for ProjectDirs
impl Sync for ProjectDirs
impl Unpin for ProjectDirs
impl UnwindSafe for ProjectDirs
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)