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::ProjectDirs, except that the
functions create the directories if they don’t exist, open them, and return
Dirs instead of returning Paths.
Unlike directories::ProjectDirs, this API has no
ProjectDirs::from_path, ProjectDirs::path or
ProjectDirs::project_path, and the *_dir functions return Dirs rather
than Paths, 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::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::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::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::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::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::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 more