Project

Struct Project 

Source
pub struct Project { /* private fields */ }
Expand description

Definition of the project essentials. Allows to retrive project directories

Implementations§

Source§

impl Project

Source

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

Source

pub fn application_name_unix(&self) -> String

Get application name for UNIX-like systems (excluding mac)

Source

pub fn application_name_windows(&self) -> String

Get application name for Windows systems

Source

pub fn application_name_macos(&self) -> String

Get application name for macOS

Source

pub fn organization_name_windows(&self) -> String

Get organization name for Windows

Source

pub fn organization_name(&self) -> &str

Get organization_name calculated for the current system

Source

pub fn application_name(&self) -> &str

Get application_name calculated for the current system

Source

pub fn qualifier(&self) -> &str

Get qualifier calculated for the current system

Source

pub fn project_dirs(&self) -> Scoped

Trait Implementations§

Source§

impl Fhs for Project

Source§

fn fhs(&self) -> FullProjectDirs

Get standard project directories. Assumes that files can be shared across the system (ex. using nfs)
Source§

fn fhs_local(&self) -> FullProjectDirs

Get local project directories. Assumes that files are not shared across the system
Source§

impl Unix for Project

Source§

fn unix_prefixed(&self, parent_path: &Path, prefix: &str) -> FullProjectDirs

Use custom prefix and parent path for the unix-style directories
Source§

fn unix_pwd(&self) -> Result<FullProjectDirs, Error>

Get path to the unix-style directories for the current working directory (PWD). Assumes prefix is “.”.
Source§

fn unix_home(&self) -> Option<FullProjectDirs>

Get path to the unix-style directories for the current user. Assumes prefix is “.”.
Source§

fn unix_binary(&self) -> Result<FullProjectDirs, Error>

Get path to the unix-style directories for the current binary. Assumes prefix is “.”.
Source§

fn unix(&self, parent_path: &Path) -> FullProjectDirs

Same as unix_prefixed, but assumes prefix is “.”
Source§

impl Windows for Project

Source§

fn windows_system_with_env(&self, env: WindowsEnv) -> ProjectDirs

Returns the project directories for the given environment (using %ProgramFiles%, and %ProgramData%) variables.
Source§

fn windows_user_with_env(&self, env: WindowsEnv) -> ProjectDirs

Returns the project directories for the given environment (using %RoamingAppData%, and %LocalAppData%) variables.
Source§

fn windows_user_local_with_env(&self, env: WindowsEnv) -> ProjectDirs

Returns the project directories for the given environment (using %LocalAppData%) variables.
Source§

fn windows_user_shared_with_env(&self, env: WindowsEnv) -> ProjectDirs

Returns the project directories for the given environment (using %RoamingAppData%) variables.
Source§

impl Xdg for Project

Source§

fn xdg_with_env_exclude_missing(&self, env: XdgEnv) -> ProjectDirs

Retrive ProjectDirs from XDG variables for the custom env. Do not use fallback to stanard directories.
Source§

fn xdg_with_env(&self, env: XdgEnv) -> Result<FullProjectDirs, XdgError>

Tries to retrive FullProjectDirs from XDG variables. May return error in case of missing home fallback
Source§

fn xdg(&self) -> Result<FullProjectDirs, XdgError>

Retrive FullProjectDirs from XDG variables. Variables are resolved from the system.

Auto Trait Implementations§

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> 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, 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.