You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: Currently, eframe only supports saving app state using RON files. This limitation restricts developers who wish to integrate with different storage systems like SQLite or handle deserialization themselves for alternative data formats.
Solution: Introduce a customization option that allows users to provide a custom storage mechanism. This could be achieved by accepting a closure or function during initialization, enabling dynamic storage creation (e.g., SQLite, PostgreSQL).
Proposed Implementation: Modify eframe to accept a Box<dyn Fn() -> Box<dyn crate::epi::Storage>> as an optional parameter in the initialization process. This closure would allow developers to return their own custom storage implementation instead of the default FileStorage.
Examples:
pubstructNativeOptions{// ... other fields ...pubpersistence_path:Option<PathBuf>,/// Override the default storage creation with your own custom storage implementationpubstorage_creator:Option<Box<dynFn() -> Option<Box<dyncrate::epi::Storage>>>>,}
The text was updated successfully, but these errors were encountered:
UnknownSuperficialNight
changed the title
Support for Custom Storage Backends and Flexible Deserialization in eframe
Add Support for Custom Storage Backends in eframe via a New NativeOptions Field
Feb 6, 2025
Same problem. Currently i’m just ignoring the provided Storage ref when saving state, pointing at my own, but i’d like to not have that RON file exist in the first place and install my own Storage properly. I have an SQLite-based settings DB and have in it a table for all the eframe stuff.
Problem: Currently, eframe only supports saving app state using RON files. This limitation restricts developers who wish to integrate with different storage systems like SQLite or handle deserialization themselves for alternative data formats.
Solution: Introduce a customization option that allows users to provide a custom storage mechanism. This could be achieved by accepting a closure or function during initialization, enabling dynamic storage creation (e.g., SQLite, PostgreSQL).
egui/crates/eframe/src/native/glow_integration.rs
Lines 193 to 209 in 0db56dc
egui/crates/eframe/src/native/epi_integration.rs
Lines 130 to 147 in 0db56dc
Proposed Implementation: Modify eframe to accept a
Box<dyn Fn() -> Box<dyn crate::epi::Storage>>
as an optional parameter in the initialization process. This closure would allow developers to return their own custom storage implementation instead of the default FileStorage.Examples:
The text was updated successfully, but these errors were encountered: