On 05-08-22, 16:25, Bartosz Golaszewski wrote: > Thank you for your hard work on that, we'll get it merged eventually. :) :) > I'm just letting you know that I am following the discussion. I sadly > don't know Rust well enough to be able to review the patches in detail > but from looking at the code, I can tell that you followed the C++ > bindings in how line-config works. Not really. I wrote the wrappers based on include/gpiod.h only and didn't look at C++ bindings for them. The only point where I looked at C++ bindings was when I was writing examples and tests. I am not a Python guy, so the only thing left was C++ :) > Looking at how line configuration > works in C++ and Rust bindings and how I struggle to translate it well > to Python, I decided to take one step back and revisit the line config > in core C API. > > My goal is to tweak the data model in a way that - while making the C > API slightly more complex - will allow high-level bindings to expose > more elegant interfaces using mutator chaining (like what is customary > in Rust and what is also possible and often used in C++ and Python) > while reducing the usage of quasi dynamic typing using std::any in > C++. Makes sense. > I wanted to post my work this week but didn't manage to finish it and > now I'm leaving for vacation. If you want to take a look, the C part > is done and available here: > https://github.com/brgl/libgpiod-private/tree/topic/rebuild-line-config. > C++ part is in progress. I did have a look at this yesterday. I would like make changes towards this once this is merged, so I don't need to do it again. > I hope you won't mind some more reworks to the Rust API Not at all. > but I'm sure > it will be much better in the end and more like what Rust libraries > typically look like. I think that the C API is still getting worked up at the moment and the modifications (at API level) won't stop after this too. We will see more improvements going forward, which is the right thing to do in order to get a robust and more user friendly API out of it. I worry if this will keep happening and keep pushing the Rust patches to be merged to libgpiod. I am fine to resend the patches on top of the rebuild-line-config changes as well though. FWIW, I will still be around after this is merged, to write/review Rust patches based on any changes to the C API. :) Enjoy your vacation. -- viresh