Serialization runs into error for ModelRc<T> #6024
-
Hello everyone! For clarification, as per slint::docs::type_mappings, I added the following directive to all my struct definitions:
The feature for serde is also active in my import
Compiling the above example returns the message that the trait bounds for serialization and deserialization for ModelRcslint::SharedString is not satisfied. This error happens for any kind of array that is attributed to a struct. There might be something I did not see, but after an extensive search I did not see anyone talk about this specific issue. ===================
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Right, there is currently not an implementation of the serde trait for the ModelRc. It could be added. |
Beta Was this translation helpful? Give feedback.
-
I just stumbled on the same problem. My a bit hacky solution is implementing Serialize/Deserialize traits for Slint structures. Gist with example |
Beta Was this translation helpful? Give feedback.
I think there is no way around but implementing it in Slint.
This file where ModelRc is defined would be the place
https://github.com/slint-ui/slint/blob/master/internal/core/model.rs