Open uditrugman opened 2 weeks ago
Generics have not been supported yet. A quick method may be to define Rust macros, such that you can easily generate arbitrary generic types.
Is there a way to add custom encode/decode for a specific generic type?
for example IndexMap\<String, usize>
I tried that already but for some reason it ignores my encode/decode functions and generate a new dart type. is there an example of how to use Encode/Decode for a generic with specific type?
Hmm then looks like it is not implemented yet. A quick workaround is to use the newtype pattern, for example:
pub struct MyIndexMapStringUsize(IndexMap<String, usize>);
and then do custom encode/decode on it.
As usual, this can be done via a macro to avoid repeating the code.
Is there a way to use custom Encoder/Decoder for IndexMap or in general to add custom encoder/decoder for Generic Types?
Thanks
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like A clear and concise description of what you want to happen.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.