Osspial / derin

A Derive-Based GUI Library for Rust
Mozilla Public License 2.0
19 stars 2 forks source link

Serde support #12

Open Osspial opened 5 years ago

Osspial commented 5 years ago

Being able to dynamically create UIs at runtime is really useful feature. Because Derin uses structs to specify the widget tree, we could in theory use Serde to load up UI trees from files. This needs further investigation, but could pose a nice way to do that which requires minimal work on our part.

scalarwaves commented 5 years ago

What data format would you try? I’ve seen UI frameworks use Json, Yaml, XML...personally I don’t like XML

RON works well with Rust types

Osspial commented 5 years ago

I wouldn't require a specific format, but ROM does seem like the best solution for downstream users. One of the great things about Serde is that you can just implement the Serialize and Deserialize traits and let the end user figure out what exactly they want to serialize and deserialize to/from.