Crate ailloli_ui_app_storage

Source
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.
AppPreferencesDocument
Versioned, extensible application-preferences payload.
AppStorage
Resolved application storage paths and optional compatibility-view settings.
AppStorageBuilder
Configures storage resolution without accessing the filesystem.
AppStorageDiagnostics
Snapshot of resolved paths, overrides, and compatibility-view readiness.
AppStorageDirs
Resolved canonical storage directories for one application.
EnvOverride
App-specific environment path that took precedence during resolution.
HomeSymlinkEntryStatus
Inspection result for one named compatibility link.
HomeSymlinkView
Optional human-facing directory whose entries link to canonical storage.
HomeSymlinkViewStatus
Filesystem inspection result for the optional symlink view.
LogicalWindowPosition
Window position in logical desktop coordinates.
LogicalWindowSize
Window inner size in logical pixels.
WindowSnapshot
Restorable state for one logical top-level window.
WindowStateDocument
Versioned set of persisted top-level window snapshots.

Enums§

AppStorageError
Failure produced while resolving paths, validating documents, or touching storage.
AppStorageMode
Strategy used to resolve the four canonical storage directories.
HomeSymlinkEntryState
State of one compatibility link.
HomeSymlinkViewState
Aggregate readiness of the optional symlink view.

Constants§

APP_PREFERENCES_VERSION
Current AppPreferencesDocument schema version written by this crate.
WINDOW_STATE_VERSION
Current WindowStateDocument schema version written by this crate.

Functions§

atomic_write_bytes
Writes bytes to <file-name>.tmp, syncs them, then renames over path.
read_optional_json
Deserializes an optional UTF-8 or binary JSON file into T.
write_json_atomic
Pretty-serializes value and writes it through a same-directory temp file.

Type Aliases§

Result
Result type returned by storage operations in this crate.