Expand description
Storage Abstraction — Unified key-value, secure, and file storage API.
Provides a trait-based storage layer that abstracts across platforms:
- Key-value store (AsyncStorage equivalent)
- Secure storage (iOS Keychain, Android Keystore, Web crypto)
- File system access (sandboxed app data)
Platform adapters implement StorageBackend for each target.
The StorageManager coordinates across backends and provides
a type-safe, thread-safe API for the rest of the engine.
Design:
- All operations are synchronous in the trait (platform can spawn internally)
StorageBackendisSend + Syncfor safe sharing across threads- Secure storage uses a separate trait method set with explicit domain tagging
Structs§
- Android
Storage Backend - Android storage backend stub. Production: SharedPreferences (KV) + Android Keystore (secure) + app files dir (files).
- Desktop
Storage Backend - Desktop storage backend stub (macOS, Windows, Linux). Production: file-based KV (JSON files) + OS keyring (secure) + file system (files).
- IosStorage
Backend - iOS storage backend stub. Production: NSUserDefaults (KV) + Keychain (secure) + FileManager (files).
- Memory
Storage Backend - In-memory storage backend for testing and as a Web fallback. All data is lost when the process exits.
- Storage
Manager - High-level storage coordinator.
Wraps a
StorageBackendand provides convenience methods. - Storage
Namespace - Namespace for isolating storage domains. Prevents key collisions between different parts of the app.
- WebStorage
Backend - Web storage backend stub. Production: localStorage (KV) + SubtleCrypto + encrypted localStorage (secure) + IndexedDB (files).
Enums§
- Storage
Error - Errors from storage operations.
- Storage
Value - Values that can be stored in key-value storage.
Traits§
- Storage
Backend - Trait that platform-specific storage implementations must implement.