Closed chertov closed 2 years ago
Hi @chertov currently only Vec
is supported, I'm planning to add HashMap and then more data types.
I'm moving as fast as I can .. gonna address that once I got wasm support wrapped up.
You could work around this for now by converting to Vec before exposing to the model or similar.
I'm also planning to allow you to [rid::exclude]
fields you don't need on the Dart side, but also have not gotten to that yet.
It's all on my radar though.
@thlorenz Thanks, i am trying to add ffi codegen for *Map types like RidVec, but today it's quite difficult for me)
To support map types will take some effort as we'd also need to generate access methods, i.e. I did this for Vec
namely len, get(idx)
, for map types there are more.
As I said I'll try to address this as soon as I get wasm support to a decent stage.
If you wanna try to implement HashMap
yourself though please LMK .. I'll try to help where I can.
@chertov see my comment in #5 regarding upcoming support for HashMap and similar.
@thlorenz thanks! The support for HashMap is very important feature! Awesome! I will try
I found a field with Vec<_> type inside a model in the todo example. But std::collections::HashMap or std::collections::BTreeMap throws the error:
It seems that the ffi implementation for the vectors is here: https://github.com/thlorenz/rid/blob/1b0214c37168ffb524b7ea2e59aae833350e9012/rid-ffi/src/lib.rs#L19
Is it possible to support std::collections maps?