Skip to content

Cleans up Restore codegen and overall naming#19

Merged
Tomaz-Vieira merged 17 commits intokreshuklab:masterfrom
Tomaz-Vieira:master
Sep 3, 2025
Merged

Cleans up Restore codegen and overall naming#19
Tomaz-Vieira merged 17 commits intokreshuklab:masterfrom
Tomaz-Vieira:master

Conversation

@Tomaz-Vieira
Copy link
Copy Markdown
Collaborator

@Tomaz-Vieira Tomaz-Vieira commented Sep 3, 2025

The Restore trait would just invisibly guess that any type using #[derive(Restore)] was implementing the associated type Restore::RawData as a type in project_data.rs named {THE_TYPE_NAME}RawData. These patches make that type explicit now, via the #[restore(saved_data=path::to::your::SavedData)] attribute. It also changes the name of the associated type from RawData to SavedData to convey that it is the data that will be persisted to disk when saving a draft. All other attributes have been changed to the #[restore(...)] style, instead of #[restore_default] or #[restore_on_update].

Notably, one place had to keep the raw_data term (instead of moving to saved_data: the key app_state_raw_data_version that tags the saved data. This is so that older saved model drafts can still be opened by this and newer versions of the app.

@Tomaz-Vieira Tomaz-Vieira merged commit 024a3bd into kreshuklab:master Sep 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant