#[non_exhaustive]#[repr(u16)]pub enum BaseDirectory {
Show 23 variants
Audio = 1,
Cache = 2,
Config = 3,
Data = 4,
LocalData = 5,
Document = 6,
Download = 7,
Picture = 8,
Public = 9,
Video = 10,
Resource = 11,
Temp = 12,
AppConfig = 13,
AppData = 14,
AppLocalData = 15,
AppCache = 16,
AppLog = 17,
Desktop = 18,
Executable = 19,
Font = 20,
Home = 21,
Runtime = 22,
Template = 23,
}Expand description
A base directory for a path.
The base directory is the optional root of a file system operation. If informed by the API call, all paths will be relative to the path of the given directory.
For more information, check the dirs documentation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Audio = 1
The Audio directory.
Cache = 2
The Cache directory.
Config = 3
The Config directory.
Data = 4
The Data directory.
LocalData = 5
The LocalData directory.
Document = 6
The Document directory.
Download = 7
The Download directory.
Picture = 8
The Picture directory.
Public = 9
The Public directory.
Video = 10
The Video directory.
Resource = 11
The Resource directory.
Temp = 12
A temporary directory. Resolves to std::env::temp_dir.
AppConfig = 13
The default app config directory.
Resolves to BaseDirectory::Config/{bundle_identifier}.
AppData = 14
The default app data directory.
Resolves to BaseDirectory::Data/{bundle_identifier}.
AppLocalData = 15
The default app local data directory.
Resolves to BaseDirectory::LocalData/{bundle_identifier}.
AppCache = 16
The default app cache directory.
Resolves to BaseDirectory::Cache/{bundle_identifier}.
AppLog = 17
The default app log directory.
Resolves to BaseDirectory::Home/Library/Logs/{bundle_identifier} on macOS
and BaseDirectory::Config/{bundle_identifier}/logs on linux and Windows.
Desktop = 18
The Desktop directory.
Executable = 19
The Executable directory.
Font = 20
The Font directory.
Home = 21
The Home directory.
Runtime = 22
The Runtime directory.
Template = 23
The Template directory.
Implementations§
source§impl BaseDirectory
impl BaseDirectory
sourcepub fn variable(self) -> &'static str
pub fn variable(self) -> &'static str
Gets the variable that represents this BaseDirectory for string paths.
sourcepub fn from_variable(variable: &str) -> Option<Self>
pub fn from_variable(variable: &str) -> Option<Self>
Gets the BaseDirectory associated with the given variable, or None if the variable doesn’t match any.
Trait Implementations§
source§impl Clone for BaseDirectory
impl Clone for BaseDirectory
source§fn clone(&self) -> BaseDirectory
fn clone(&self) -> BaseDirectory
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for BaseDirectory
impl Debug for BaseDirectory
source§impl<'de> Deserialize<'de> for BaseDirectory
impl<'de> Deserialize<'de> for BaseDirectory
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl Serialize for BaseDirectory
impl Serialize for BaseDirectory
impl Copy for BaseDirectory
Auto Trait Implementations§
impl Freeze for BaseDirectory
impl RefUnwindSafe for BaseDirectory
impl Send for BaseDirectory
impl Sync for BaseDirectory
impl Unpin for BaseDirectory
impl UnwindSafe for BaseDirectory
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)