Skip to main content

ashlar_fs/
lib.rs

1//! Files and settings: app dirs, durable atomic writes, keyed settings, recent files.
2//!
3//! - [`AppDirs`]: where an app keeps its config, data, cache and logs on each OS.
4//! - [`atomic_write`]: replace a file so a crash or power cut leaves the old or the new content,
5//!   never a torn mix.
6//! - [`ConfigStore`] / [`FileOps`]: the storage seen by settings, autosave and recovery, with disk
7//!   and in-memory backends (browser storage plugs in here).
8//! - [`Settings`]: keyed JSON with typed getters, a schema version and a debounced durable save.
9//! - [`RecentFiles`]: a most-recently-used list.
10//!
11//! Headless and wasm32-clean: on the web the disk backends compile but report errors; use the
12//! in-memory ones or a browser-storage backend.
13#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
14
15pub mod atomic;
16pub mod backend;
17pub mod dirs;
18pub mod recent;
19pub mod settings;
20
21pub use atomic::{atomic_write, atomic_write_with};
22pub use backend::{ConfigStore, DirConfig, FileOps, MemFiles, MemoryConfig, StdFiles};
23pub use dirs::AppDirs;
24pub use recent::RecentFiles;
25pub use settings::{LoadState, Settings, SettingsMigration};