embassy icon indicating copy to clipboard operation
embassy copied to clipboard

AsyncWrite

Open DanielMadmon opened this issue 1 year ago • 3 comments

Is there an equivalence to Tokio::AsyncWrite?

DanielMadmon avatar Mar 04 '24 20:03 DanielMadmon

yep! https://docs.rs/embedded-io-async/latest/embedded_io_async/trait.Write.html

Dirbaio avatar Mar 04 '24 20:03 Dirbaio

Thank you, is there an example for usage within embassy?

DanielMadmon avatar Mar 04 '24 20:03 DanielMadmon

Embassy implements the traits for stuff like UART, and embassy-net TCP. Here's one example of it being used in a TCP socket: https://github.com/embassy-rs/embassy/blob/60567b72fb8807bf72aa28f0e2c551953c1ef7bf/examples/rp/src/bin/wifi_tcp_server.rs#L146

you can search the repo for more https://github.com/search?q=repo%3Aembassy-rs%2Fembassy%20embedded_io_async&type=code

Dirbaio avatar Mar 04 '24 21:03 Dirbaio

I'm considering this answered, reopen if not.

lulf avatar Mar 21 '24 07:03 lulf