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 Dirs instead of returning Paths.

Unlike directories_next::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

source

pub fn from(
    qualifier: &str,
    organization: &str,
    application: &str,
    _: 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.

source

pub fn cache_dir(&self) -> Result<Dir>

Returns the project’s cache directory.

This corresponds to directories_next::ProjectDirs::cache_dir.

source

pub fn config_dir(&self) -> Result<Dir>

Returns the project’s config directory.

This corresponds to directories_next::ProjectDirs::config_dir.

source

pub fn data_dir(&self) -> Result<Dir>

Returns the project’s data directory.

This corresponds to directories_next::ProjectDirs::data_dir.

source

pub fn data_local_dir(&self) -> Result<Dir>

Returns the project’s local data directory.

This corresponds to directories_next::ProjectDirs::data_local_dir.

source

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

source§

fn clone(&self) -> ProjectDirs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere
    T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.