pub enum StoringType {
Cache,
Data,
Config,
Custom(PathBuf),
}Expand description
Represents the different types of storage locations that can be used for storing data.
The StoringType enum provides a way to specify where data should be stored, based on the
platform and the type of data. It includes variants for common storage locations such as
cache, data, and configuration directories, as well as a custom path option.
§Variants
Cache: Path to the user’s cache directory.Data: Path to the user’s data directory.Config: Path to the user’s configuration directory.Custom(PathBuf): Custom path specified by the user.
Variants§
Cache
Path to the user’s cache directory.
| Platform | Value | Example |
|---|---|---|
| Linux | $XDG_CACHE_HOME or $HOME/.cache | /home/alice/.cache |
| macOS | $HOME/Library/Caches | /Users/Alice/Library/Caches |
| Windows | {FOLDERID_LocalAppData} | C:\Users\Alice\AppData\Local |
Data
Path to the user’s data directory.
| Platform | Value | Example |
|---|---|---|
| Linux | $XDG_DATA_HOME or $HOME/.local/share | /home/alice/.local/share |
| macOS | $HOME/Library/Application Support | /Users/Alice/Library/Application Support |
| Windows | {FOLDERID_RoamingAppData} | C:\Users\Alice\AppData\Roaming |
Config
Path to the user’s config directory.
| Platform | Value | Example |
|---|---|---|
| Linux | $XDG_CONFIG_HOME or $HOME/.config | /home/alice/.config |
| macOS | $HOME/Library/Application Support | /Users/Alice/Library/Application Support |
| Windows | {FOLDERID_RoamingAppData} | C:\Users\Alice\AppData\Roaming |
Custom(PathBuf)
Custom path of the store save location
Trait Implementations§
Source§impl Debug for StoringType
impl Debug for StoringType
Source§impl Default for StoringType
impl Default for StoringType
Source§fn default() -> StoringType
fn default() -> StoringType
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StoringType
impl RefUnwindSafe for StoringType
impl Send for StoringType
impl Sync for StoringType
impl Unpin for StoringType
impl UnwindSafe for StoringType
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