Registry / networking / async-net

async-net

JSON →
library2.0.0rscratesunverified

Async networking primitives for TCP/UDP/Unix communication

# Cargo.toml [dependencies] async-net = "2.0.0"
INSTALL
IMPORT
SIG · ASYNC-NET
A
async-net
networkingrustv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TcpStream
use async_net::TcpStream;

Connect to a TCP server using async-net

use async_net::TcpStream; #[async_std::main] async fn main() -> std::io::Result<()> { let stream = TcpStream::connect("127.0.0.1:8080").await?; println!("Connected"); Ok(()) }
Debug
Known issues
gotchaRequires an async runtime like async-std or smol
fix
Add async-std or smol as a dependency and use their main attribute
affects: >=2.0.0
Upgrade
Version history
2.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
32
OpenAI (training)
1
Resources
async-net — cargo add async-net · libregistry