robohouse-delft / aravis-rs

Rust bindings for Aravis, a vision library for genicam based cameras
Other
14 stars 5 forks source link

add get/set functions to GcRegisterExt trait #16

Closed dan-jfisher closed 1 year ago

de-vri-es commented 1 year ago

We should not be using pointers in safe interfaces. Also, we shouldn't manually add things to the generated files in src/auto.

The proper way to do this is to tell gir how to transform those function arguments so it can generate the bindings automatically. Or, if we have to, we can add a manual extension trait :'(

de-vri-es commented 1 year ago

set should probably take a &[u8] and get should probably take an &mut [u8]. How to get gir to understand that, I don't know though.

dan-jfisher commented 1 year ago

I definitely don't know how to get gir to do that, so I vote for a manual extension. If you think that's reasonably I'm happy to make it.

de-vri-es commented 1 year ago

Sure, its a good short term solution :)

de-vri-es commented 1 year ago

The implementation looks good, but I don't like the names that much. Maybe get_bytes() and set_bytes()? Or get_raw() and set_raw()?

Also, could you add doc comments, and include a note there about preferring to use the typed interfaces when possible?

de-vri-es commented 1 year ago

Released as 0.9.1 :rocket: