esp-rs / esp-idf-svc

Type-Safe Rust Wrappers for various ESP-IDF services (WiFi, Network, Httpd, Logging, etc.)
https://docs.esp-rs.org/esp-idf-svc/
Apache License 2.0
309 stars 175 forks source link

Owned network callback parameters #406

Closed owenthewizard closed 5 months ago

owenthewizard commented 5 months ago

Related: #401

I think it would make sense for the *Driver callbacks to use owned parameters rather than references (slices). This way they can be e.g. sent via mpsc::channel without another allocation, e.g. to_vec().

I'm not the most experienced with Rust so I'm very open to feedback and further guidance.

owenthewizard commented 5 months ago

I haven't implemented the same changes for the Wi-Fi TX callback since I don't know where that memory is allocated/freed.

ivmarkov commented 5 months ago

Thanks!