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
I haven't found any documentation on this one, so I wanted to file an enhancement request - if this is already possible please disregard.
So my objective is I'm reading in a toml/json config file and parts of the structure are well known/mandatory but others are optional and. So I want to end up with something like
#[derive(Deserialize)]structConfig{name:String,age:u8,all_the_rest:HashMap<String,Any>// I guess where any is something like toml::Value or serde_json::Value}
So when I read the config in, all the attributes that are not name or age get fed into the all_the_rest hashmap instead of being ignored.
This has the related question of the Any in the value - would it be possible to make this generic over the input format, so I don't need to actually store a toml::Value or a serde_json::Value `?
The text was updated successfully, but these errors were encountered:
Hi,
I haven't found any documentation on this one, so I wanted to file an enhancement request - if this is already possible please disregard.
So my objective is I'm reading in a toml/json config file and parts of the structure are well known/mandatory but others are optional and. So I want to end up with something like
So when I read the config in, all the attributes that are not
name
orage
get fed into theall_the_rest
hashmap instead of being ignored.This has the related question of the
Any
in the value - would it be possible to make this generic over the input format, so I don't need to actually store atoml::Value
or aserde_json::Value
`?The text was updated successfully, but these errors were encountered: