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
333 stars 183 forks source link

Owned network callback parameters #406

Closed owenthewizard closed 7 months ago

owenthewizard commented 7 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 7 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 7 months ago

Thanks!