Deal with higher-level network protocols such as FTP (File Transfer Protocol), HTTP (Hypertext Transfer Protocol), or SSH, or lower-level network protocols such as TCP (Transmission Control Protocol) or UDP (User Datagram Protocol).
Topic
Rust Crates
Basic networking, Network Sockets (Low-Level)
Use std::net (in the standard library) for simple TCP/UDP communication, including TCP and UDP sockets.
High-performance, asynchronous networking
tokio⮳ is a powerful and widely used asynchronous runtime, and essential for building high-performance network applications. It provides abstractions for working with sockets, streams, and other network primitives asynchronously. Consider smol⮳ as well. mio⮳ is a lower-level I/O library used by tokio⮳. You'll rarely use mio⮳ directly unless you have very specific performance needs.
Many crates exist for specific protocols (e.g., SMTP, IMAP, SSH).
For building web servers, axum⮳ or actix-web⮳ are popular options. actix-web⮳ is a powerful and ergonomic web framework built on top of hyper⮳. warp⮳ is a lightweight and composable web framework. axum⮳ is a newer web framework with a focus on type safety and developer experience. hyper⮳ is a low-level HTTP library, often used to build custom HTTP clients or servers.
WebSockets
Use tokio-tungstenite⮳, a WebSocket library built on tokio⮳, for bidirectional communication between a client and server. tungstenite⮳ is a lower-level WebSocket library.
Serialization/Deserialization
serde⮳ is a widely used serialization framework, often used to serialize data before sending it over the network and deserialize it after receiving it.