Hosts a bunch of traits which hopefully will be upstreamed into embedded-nal-async at some point in time - in one shape or another.
Differences with embedded-nal-async
- Factory traits for the creation of TCP server sockets -
TcpBind
andTcpAccept
.embedded-nal-async
only hasTcpConnect
- Splittable sockets with
TcpSplit
(can be optionally implemented byTcpConnect
andTcpAccept
)
- Separate
UdpSend
andUdpReceive
traits for modeling the sending / receiving functinality of a UDP socket. Necessary for protocols that need UDP socket splitting, like mDNS responder - Binding to a UDP socket and connecting to a UDP socket modeled with separate traits -
UdpBind
andUdpConnect
, as not all platforms currently have capabilities to connect to a UDP socket (i.e. the networking stack of Embassy) - Returning the local address of a UDP socket bind / connect operation is not supported, as not all platforms currently have this capability (i.e. the networking stack of Embassy)
- "Unbound" UDP sockets are currently not supported, as not all platforms have these capabilities (i.e. the networking stack of Embassy). Also, I've yet to find a good use case for these.
- Splittable sockets with
UdpSplit
(can be optionally implemented byUdpConnect
andUdpBind
) Multicast
trait for joining / leaving IPv4 and IPv6 multicast groups (can be optionally implemented byUdpConnect
andUdpBind
)
These traits are necessary to unlock the full functionality of some crates in edge-net
, which is not possible with the current traits of embedded-nal-async
.
Namely:
- edge-mdns - needs UDP multicast capabilities as well as socket splitting
- edge-dhcp - needs raw ethernet socket capabilities or at least sending/receiving UDP packets to/from peers identified by their MAC addresses rather than by their IP addresses
- edge-http - (full server only) needs a way to bind to a server-side TCP socket
- edge-ws - Most WebSocket use cases do require a splittable TCP socket (separate read and write halves)
- TcpSplit
- A trait that - when implemented on a TCP socket - allows for splitting the send and receive halves of the socket for full-duplex functionality
- TcpConnect
- Client-side TCP socket factory similar in spirit to STD's
std::net::TcpListener::connect
method
- Client-side TCP socket factory similar in spirit to STD's
- TcpBind
- Server-side TCP socket factory similar in spirit to STD's
std::net::TcpListener::bind
method andstd::net::TcpListener
struct
- Server-side TCP socket factory similar in spirit to STD's
- TcpAccept
- The acceptor of the server-side TCP socket factory similar in spirit to STD's
std::net::TcpListener::bind
method andstd::net::TcpListener
struct
- The acceptor of the server-side TCP socket factory similar in spirit to STD's
- UdpReceive
- The receiver half of a UDP socket
- UdpSend
- The sender half of a UDP socket
- UdpSplit
- A trait that - when implemented on a UDP socket - allows for splitting the send and receive halves of the socket for full-duplex functionality
- UdpBind
- Udp socket factory similar in spirit to STD's
std::net::UdpSocket::bind
method
- Udp socket factory similar in spirit to STD's
- UdpConnect
- Udp socket factory similar in spirit to STD's
std::net::UdpSocket::connect
method
- Udp socket factory similar in spirit to STD's
- Multicast
- Extra trait for UDP sockets allowing subscription to multicast groups
- RawReceive
- The receiver half of a raw socket
- RawSend
- The sender half of a raw socket
- RawSplit
- A trait that - when implemented on a raw socket - allows for splitting the send and receive halves of the socket for full-duplex functionality
- RawBind
- A raw socket factory