{"id":69951,"library":"tokio-io-timeout","title":"Tokio IO Timeout","description":"Tokio wrappers which apply timeouts to IO operations like read and write.","status":"active","version":"1.2.1","language":"rust","source_language":null,"source_url":"https://github.com/sfackler/tokio-io-timeout","tags":["tokio","io","timeout","async"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\ntokio-io-timeout = \"1.2.1\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add tokio-io-timeout","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"TimeoutReader","correct":"use tokio_io_timeout::TimeoutReader;"}],"quickstart":{"code":"use tokio_io_timeout::TimeoutReader;\nuse tokio::io::AsyncReadExt;\nuse std::time::Duration;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let stream = tokio::net::TcpStream::connect(\"127.0.0.1:8080\").await?;\n    let mut reader = TimeoutReader::new(stream);\n    reader.set_timeout(Some(Duration::from_secs(5)));\n    let mut buf = vec![0; 1024];\n    let n = reader.read(&mut buf).await?;\n    println!(\"Read {} bytes\", n);\n    Ok(())\n}","lang":"rust","description":"Wrap a TCP stream with a read timeout."},"warnings":[{"fix":"Use set_timeout before each read/write if you need dynamic timeouts.","message":"Timeouts are applied per IO operation, not per connection; ensure you set them appropriately.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'appli':7 'async':19 'io':2,10,17 'like':12 'oper':11 'read':13 'timeout':3,8,18 'tokio':1,4,16 'wrapper':5 'write':15","created_at":"2026-06-17T18:07:49.085195+00:00","updated_at":"2026-06-17T18:07:49.085195+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/sfackler/tokio-io-timeout","github":"https://github.com/sfackler/tokio-io-timeout","docs":"https://docs.rs/tokio-io-timeout/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["networking","async"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}