-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi,
I am out looking for an mDNS implementation suitable for no_std (without alloc crate), when I came across this crate. While I think it is correct to call this code "agnostic" – it is generic over some specific async runtimes – it is not following the regular definition of Sans-IO.
The key point of Sans-IO is to separate the IO concern away from the code. This means concepts like "TcpSocket" or "UdpSocket" should not be internal to the library/component. Here's a great blog post explaining it: https://www.firezone.dev/blog/sans-io
In agnostic there is code that we do not expect to find in Sans-IO. There should be no binding/writing/reading from anything called "socket". Such concerns are abstracted outside of the library:
https://github.com/al8n/agnostic/blob/main/agnostic-dns/src/lib.rs#L234
Here are some examples of Sans-IO libraries in Rust:
- quinn-proto (HTTP/3): https://docs.rs/quinn-proto/0.11.8/quinn_proto/
- str0m (WebRTC): https://crates.io/crates/str0m (my own)
Another example is ureq-proto, where I've abstracted the HTTP/1.1 protocol from the actual network code: https://docs.rs/ureq-proto/0.3.0/ureq_proto/client/index.html#example