pub struct PlatformDirs {
pub home: PathBuf,
pub config: PathBuf,
pub data: PathBuf,
pub cache: PathBuf,
pub state: Option<PathBuf>,
pub runtime: Option<PathBuf>,
pub temp: PathBuf,
}Expand description
Platform-standard directories for the current user / process.
§Platform notes
Windows
- Home:
%USERPROFILE% - Config / roaming data:
%APPDATA% - Local data / cache:
%LOCALAPPDATA% - Temp:
%TEMP%or%TMP%
macOS
- Home:
$HOME - Config / data:
~/Library/Application Support - Cache:
~/Library/Caches - Temp:
$TMPDIR
Linux
- Home:
$HOME - Config:
$XDG_CONFIG_HOMEor~/.config - Data:
$XDG_DATA_HOMEor~/.local/share - Cache:
$XDG_CACHE_HOMEor~/.cache - State:
$XDG_STATE_HOMEor~/.local/statewhen available - Runtime:
$XDG_RUNTIME_DIRwhen available - Temp:
$TMPDIRor system temp
Fields§
§home: PathBufUser home directory.
config: PathBufUser configuration directory.
data: PathBufUser data directory.
cache: PathBufUser cache directory.
state: Option<PathBuf>User state directory (XDG state), when available.
runtime: Option<PathBuf>Runtime directory (XDG runtime), when available.
temp: PathBufTemporary directory.
Trait Implementations§
Source§impl Clone for PlatformDirs
impl Clone for PlatformDirs
Source§fn clone(&self) -> PlatformDirs
fn clone(&self) -> PlatformDirs
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlatformDirs
impl Debug for PlatformDirs
impl Eq for PlatformDirs
Source§impl PartialEq for PlatformDirs
impl PartialEq for PlatformDirs
impl StructuralPartialEq for PlatformDirs
Auto Trait Implementations§
impl Freeze for PlatformDirs
impl RefUnwindSafe for PlatformDirs
impl Send for PlatformDirs
impl Sync for PlatformDirs
impl Unpin for PlatformDirs
impl UnsafeUnpin for PlatformDirs
impl UnwindSafe for PlatformDirs
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