OptionalStruct icon indicating copy to clipboard operation
OptionalStruct copied to clipboard

Feature request: support struct attributes of the form HashMap<key, OptionalStruct> and Vec<OptionalStruct>

Open cortesi opened this issue 1 year ago • 0 comments

Thanks for the very handy library, which has made managing config files in tenx much nicer. It would be great to have support for HashMap and Vec struct attributes, where the contained values are themselves optional structs. Ideally, I'd like to be able to do something like this:

#[optional_struct]
#[derive(Eq, PartialEq, Debug)]
struct ValueStruct {
... 
}

#[optional_struct]
#[derive(Eq, PartialEq, Debug)]
struct MyStruct {
        #[optional_hash(OptionalValueStruct)]
        #[optional_wrap]
        mymap: HashMap<String, ValueStruct>
}

cortesi avatar Dec 22 '24 23:12 cortesi