StoringType

Enum StoringType 

Source
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.

PlatformValueExample
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.

PlatformValueExample
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.

PlatformValueExample
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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StoringType

Source§

fn default() -> StoringType

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.