Struct cap_directories::ProjectDirs[][src]

pub struct ProjectDirs { /* fields omitted */ }

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

impl ProjectDirs[src]

pub unsafe fn from(
    qualifier: &str,
    organization: &str,
    application: &str
) -> Option<Self>
[src]

Creates a ProjectDirs struct from values describing the project.

This corresponds to directories_next::ProjectDirs::from.

Safety

This function is unsafe because it makes use of ambient authority to access the project directories, which doesn’t uphold the invariant of the rest of the API. It is otherwise safe to use.

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

Returns the project’s cache directory.

This corresponds to directories_next::ProjectDirs::cache_dir.

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

Returns the project’s config directory.

This corresponds to directories_next::ProjectDirs::config_dir.

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

Returns the project’s data directory.

This corresponds to directories_next::ProjectDirs::data_dir.

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

Returns the project’s local data directory.

This corresponds to directories_next::ProjectDirs::data_local_dir.

pub fn runtime_dir(&self) -> Result<Dir>[src]

Returns the project’s runtime directory.

This corresponds to directories_next::ProjectDirs::runtime_dir.

Trait Implementations

impl Clone for ProjectDirs[src]

fn clone(&self) -> ProjectDirs[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.