shekohex / allo-isolate

Run Multithreaded Rust along with Dart VM (in isolate) 🌀
Apache License 2.0
120 stars 18 forks source link

Add basic support for vec of chrono types #32

Closed Roms1383 closed 2 years ago

Roms1383 commented 2 years ago

Hello! I didn't realized last time after implementing support for chrono that I omitted Vec and array. So here they are, I took a naive approach because I wasn't sure if using dart_typed_data_type_trait_impl was the right thing to do (chrono types are slightly different since they boild down to their inner type, i64). I can change the implementation if needed.

Roms1383 commented 2 years ago

The second commit I'm not quite so sure : would this give me support for ZeroCopyBuffer out of the box ? Also, I haven't implemented it for chrono::Duration because num_microseconds() might yield a None and I don't know how it relates with DartTypedDataTypeTrait. For the siblings types I assumed it would work like their inner type, so DartTypedDataType::Int64 and free_zero_copy_buffer_i64.

Roms1383 commented 2 years ago

any feedback @shekohex ?

shekohex commented 2 years ago

The second commit I'm not quite so sure : would this give me support for ZeroCopyBuffer out of the box ?

Yes, it should work, you can even write tests for it to confirm that. but it should work if you wrapped the inner vec with ZeroCopyBuffer