pub trait PersistedValueKey:
Internal
+ Send
+ Sync
+ 'static {
type Value: Persist;
const NAME: &'static str;
}Expand description
Type-safe key for persisted values storage.
Associates a string key name with a value type at compile time, preventing type mismatches while maintaining ergonomic usage.
Use the register_persisted_value! macro to create keys.
§Example
use bitwarden_state::register_persisted_value;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
struct AppConfig {
theme: String,
auto_save: bool,
}
register_persisted_value!(CONFIG: AppConfig = "app_config");Required Associated Constants§
Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".