Module base_strategy

Module base_strategy 

Source
Expand description

These strategies simply provide the user’s configuration, data, and cache directories, without knowing about the application specifically.

Structs§

Apple
This is the strategy created by Apple for use on macOS and iOS devices. It is always used by GUI apps on macOS, and is sometimes used by command-line applications there too. iOS only has GUIs, so all iOS applications follow this strategy. The specification is available here.
Windows
This strategy follows Windows’ conventions. It seems that all Windows GUI apps, and some command-line ones follow this pattern. The specification is available here.
Xdg
This strategy implements the XDG Base Directories Specification. It is the most common on Linux, but is increasingly being adopted elsewhere.

Traits§

BaseStrategy
Provides configuration, data, and cache directories of the current user.

Functions§

choose_base_strategy
Returns the current OS’s default BaseStrategy. This uses the Windows strategy on Windows, and Xdg everywhere else. This is the convention used by most CLI applications.
choose_native_strategy
Returns the current OS’s native BaseStrategy. This uses the Windows strategy on Windows, Apple on macOS & iOS, and Xdg everywhere else. This is the convention used by most GUI applications.