Expand description
Centralised ~/.cipherstash/ profile file management.
The core type is ProfileStore, a directory-scoped JSON file store that
handles reading, writing, and deleting profile data on disk.
§Example
use stack_profile::ProfileStore;
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
struct MyConfig {
name: String,
}
let store = ProfileStore::default();
store.save("my-config.json", &MyConfig { name: "example".into() })?;
let config: MyConfig = store.load("my-config.json")?;For sensitive files, use ProfileStore::save_with_mode to restrict permissions:
let store = ProfileStore::default();
store.save_with_mode("secret.json", &Secret { key: "shhh".into() }, 0o600)?;Structs§
- Device
Identity - Persistent identity for a CLI installation.
- Profile
Store - A directory-scoped JSON file store for profile data.
Enums§
- Profile
Error - Errors that can occur when reading or writing profile files.
Traits§
- Profile
Data - A type that can be stored in a profile directory.