Struct ProjectPath

Source
pub struct ProjectPath<'a> {
    pub qualifier: &'a str,
    pub organization: &'a str,
    pub application: &'a str,
}
Expand description

Your application’s metadata.

This is mainly used to figure out the system-level storage directory for your application.

See directories::ProjectDirs for more information.

Fields§

§qualifier: &'a str

The qualifier of your application.

E.g. com in com.GitHub.application.

§organization: &'a str

The organization name of your application.

E.g. GitHub in com.GitHub.application.

§application: &'a str

Your application’s name.

E.g. application in com.GitHub.application.

Implementations§

Source§

impl<'a> ProjectPath<'a>

Source

pub const fn new( qualifier: &'a str, organization: &'a str, application: &'a str, ) -> Self

Create a new ProjectPath.

Source

pub const fn with_qualifier(self, qualifier: &'a str) -> Self

Modify the qualifier field.

Source

pub const fn with_organization(self, organization: &'a str) -> Self

Modify the organization field.

Source

pub const fn with_application(self, application: &'a str) -> Self

Modify the application field.

Source

pub fn sys_config_dir(&self) -> Option<PathBuf>

Get the configuration directory of your application.

See directories::ProjectDirs::config_dir for more information.

Source

pub fn sys_preference_dir(&self) -> Option<PathBuf>

Get the preference directory of your application.

See directories::ProjectDirs::preference_dir for more information.

Source

pub fn sys_dir(&self, cfg_sys_type: ConfigType) -> Option<PathBuf>

Get the system-level config directory of your application.

Depends on ConfigOption.config_sys_type:

Trait Implementations§

Source§

impl<'a> Clone for ProjectPath<'a>

Source§

fn clone(&self) -> ProjectPath<'a>

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
Source§

impl<'a> Debug for ProjectPath<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> PartialEq for ProjectPath<'a>

Source§

fn eq(&self, other: &ProjectPath<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Eq for ProjectPath<'a>

Source§

impl<'a> StructuralPartialEq for ProjectPath<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for ProjectPath<'a>

§

impl<'a> RefUnwindSafe for ProjectPath<'a>

§

impl<'a> Send for ProjectPath<'a>

§

impl<'a> Sync for ProjectPath<'a>

§

impl<'a> Unpin for ProjectPath<'a>

§

impl<'a> UnwindSafe for ProjectPath<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.