etcetera

Module app_strategy

Source
Expand description

These strategies require you to provide some information on your application, and they will in turn locate the configuration/data/cache directory specifically for your application.

Structs§

AppStrategyArgs
The arguments to the creator method of an AppStrategy.
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.
Unix
This strategy has no standard or official specification. It has arisen over time through hundreds of Unixy tools. Vim and Cargo are notable examples whose configuration/data/cache directory layouts are similar to those created by this strategy.
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§

AppStrategy
Allows applications to retrieve the paths of configuration, data, and cache directories specifically for them.

Functions§

choose_app_strategy
Returns the current OS’s default AppStrategy. 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 AppStrategy. This uses the Windows strategy on Windows, Apple on macOS & iOS, and Xdg everywhere else. This is the convention used by most GUI applications.