Expand description
App-level storage paths, diagnostics, and small persisted documents.
The canonical storage layout follows XDG directories. A home-directory symlink view can be created as an optional user-facing convenience, but it is never the source of truth.
§Examples
use ailloli_ui_app_storage::AppStorage;
let storage = AppStorage::for_app("example-app")
.resolve_with_env(|key| (key == "HOME").then(|| "/var/empty/example-user".into()))?;
assert_eq!(storage.config_dir().to_string_lossy(), "/var/empty/example-user/.config/example-app");Structs§
- AppId
- Filename-safe application identifier used as the leaf of storage paths.
- AppPreferences
Document - Versioned, extensible application-preferences payload.
- AppStorage
- Resolved application storage paths and optional compatibility-view settings.
- AppStorage
Builder - Configures storage resolution without accessing the filesystem.
- AppStorage
Diagnostics - Snapshot of resolved paths, overrides, and compatibility-view readiness.
- AppStorage
Dirs - Resolved canonical storage directories for one application.
- EnvOverride
- App-specific environment path that took precedence during resolution.
- Home
Symlink Entry Status - Inspection result for one named compatibility link.
- Home
Symlink View - Optional human-facing directory whose entries link to canonical storage.
- Home
Symlink View Status - Filesystem inspection result for the optional symlink view.
- Logical
Window Position - Window position in logical desktop coordinates.
- Logical
Window Size - Window inner size in logical pixels.
- Window
Snapshot - Restorable state for one logical top-level window.
- Window
State Document - Versioned set of persisted top-level window snapshots.
Enums§
- AppStorage
Error - Failure produced while resolving paths, validating documents, or touching storage.
- AppStorage
Mode - Strategy used to resolve the four canonical storage directories.
- Home
Symlink Entry State - State of one compatibility link.
- Home
Symlink View State - Aggregate readiness of the optional symlink view.
Constants§
- APP_
PREFERENCES_ VERSION - Current
AppPreferencesDocumentschema version written by this crate. - WINDOW_
STATE_ VERSION - Current
WindowStateDocumentschema version written by this crate.
Functions§
- atomic_
write_ bytes - Writes bytes to
<file-name>.tmp, syncs them, then renames overpath. - read_
optional_ json - Deserializes an optional UTF-8 or binary JSON file into
T. - write_
json_ atomic - Pretty-serializes
valueand writes it through a same-directory temp file.
Type Aliases§
- Result
- Result type returned by storage operations in this crate.