pub struct App<'a> { /* private fields */ }dirs only.Expand description
Represents the application’s directories.
Main entry point to obtain any directory for your application.
These APIs will fail as last resort. If they fail it usually means the system has a problem. The system may also include specific configuration to break applications on purpose, in which case these APIs will also fail.
These APIs do not automatically create the directories, instead they return a matching instance of AppPath.
Implementations§
source§impl<'a> App<'a>
impl<'a> App<'a>
sourcepub fn get_data(&self) -> Option<AppPath<'_>>
pub fn get_data(&self) -> Option<AppPath<'_>>
Returns the path to this application’s files.
Use this directory to store any information not intended to be user accessible. Returns None if this system doesn’t have any application writable location; this should never occur on any supported system except if such system is broken.
sourcepub fn get_cache(&self) -> Option<AppPath<'_>>
pub fn get_cache(&self) -> Option<AppPath<'_>>
Returns the path to this application’s cache.
Use this directory to store cached files such as downloads, intermediate files, etc.
This function first tries to use get_app_cache/{APP} and falls back to get_data/Cache.
sourcepub fn get_documents(&self) -> Option<AppPath<'_>>
pub fn get_documents(&self) -> Option<AppPath<'_>>
Returns the path to this application’s public documents.
Use this directory to store any content the user should see and alter.
This function first tries to use get_app_documents and falls back to get_data/Documents.
sourcepub fn get_logs(&self) -> Option<AppPath<'_>>
pub fn get_logs(&self) -> Option<AppPath<'_>>
Returns the path to this application’s logs.
Use this directory to store all logs. The user can view and alter this directory.
This function first tries to use get_app_logs/{APP} and falls back to get_documents/Logs.
sourcepub fn get_config(&self) -> Option<AppPath<'_>>
pub fn get_config(&self) -> Option<AppPath<'_>>
Returns the path to this application’s config.
Use this directory to store all configs for the current user. This directory is not intended for direct user access.
This function first tries to use get_app_config/{APP} and falls back to get_data/Config.