pub struct Project { /* private fields */ }
Expand description
Definition of the project essentials. Allows to retrive project directories
Implementations§
Source§impl Project
impl Project
pub fn new(qualifier: &str, organization: &str, application: &str) -> Self
Sourcepub fn application_name_unix(&self) -> String
pub fn application_name_unix(&self) -> String
Get application name for UNIX-like systems (excluding mac)
Sourcepub fn application_name_windows(&self) -> String
pub fn application_name_windows(&self) -> String
Get application name for Windows systems
Sourcepub fn application_name_macos(&self) -> String
pub fn application_name_macos(&self) -> String
Get application name for macOS
Sourcepub fn organization_name_windows(&self) -> String
pub fn organization_name_windows(&self) -> String
Get organization name for Windows
Sourcepub fn organization_name(&self) -> &str
pub fn organization_name(&self) -> &str
Get organization_name calculated for the current system
Sourcepub fn application_name(&self) -> &str
pub fn application_name(&self) -> &str
Get application_name calculated for the current system
pub fn project_dirs(&self) -> Scoped
Trait Implementations§
Source§impl Fhs for Project
impl Fhs for Project
Source§fn fhs(&self) -> FullProjectDirs
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
fn fhs_local(&self) -> FullProjectDirs
Get local project directories. Assumes that files are not shared across the system
Source§impl Unix for Project
impl Unix for Project
Source§fn unix_prefixed(&self, parent_path: &Path, prefix: &str) -> FullProjectDirs
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>
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>
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>
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
fn unix(&self, parent_path: &Path) -> FullProjectDirs
Same as unix_prefixed, but assumes prefix is “.”
Source§impl Windows for Project
impl Windows for Project
Source§fn windows_system_with_env(&self, env: WindowsEnv) -> ProjectDirs
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
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
fn windows_user_local_with_env(&self, env: WindowsEnv) -> ProjectDirs
Returns the project directories for the given environment (using %LocalAppData%) variables.
Returns the project directories for the given environment (using %RoamingAppData%) variables.
Source§impl Xdg for Project
impl Xdg for Project
Source§fn xdg_with_env_exclude_missing(&self, env: XdgEnv) -> ProjectDirs
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>
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 fallbackSource§fn xdg(&self) -> Result<FullProjectDirs, XdgError>
fn xdg(&self) -> Result<FullProjectDirs, XdgError>
Retrive
FullProjectDirs
from XDG variables. Variables are resolved from the system.Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnwindSafe for Project
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more