Registry / networking / tokio-tcp

tokio-tcp

JSON →
library0.1.4rscratesunverified

TCP bindings for the Tokio async runtime, providing async TCP streams and listeners.

# Cargo.toml [dependencies] tokio-tcp = "0.1.4"
INSTALL
IMPORT
SIG · TOKIO-TCP
T
tokio-tcp
networkingrustv0.1.4
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 tokio_tcp::TcpStream;

Connecting to a TCP server using tokio-tcp.

use tokio_tcp::TcpStream; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let stream = TcpStream::connect("127.0.0.1:8080").await?; println!("Connected!"); Ok(()) }
Debug
Known issues
gotchaRequires Tokio runtime to be active; using outside of tokio context will panic.
fix
Ensure you are running within a tokio runtime, e.g., #[tokio::main] or tokio::runtime::Runtime::new().block_on().
affects: >=0.1.0
Upgrade
Version history
0.1.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
26
Resources
tokio-tcp — cargo add tokio-tcp · libregistry