{"id":15373074,"url":"https://github.com/vi/tokio-stdin-stdout","last_synced_at":"2025-04-15T11:33:07.246Z","repository":{"id":57670164,"uuid":"106751531","full_name":"vi/tokio-stdin-stdout","owner":"vi","description":"AsyncRead/AsyncWrite stdin/stdout for legacy pre-0.1 Tokio","archived":false,"fork":false,"pushed_at":"2018-10-31T22:51:23.000Z","size":29,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T21:03:06.895Z","etag":null,"topics":["asynchronous","rust","rust-library","stdin","stdio","stdout","tokio"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-12T22:24:19.000Z","updated_at":"2023-05-21T15:29:04.000Z","dependencies_parsed_at":"2022-09-26T20:40:38.158Z","dependency_job_id":null,"html_url":"https://github.com/vi/tokio-stdin-stdout","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Ftokio-stdin-stdout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Ftokio-stdin-stdout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Ftokio-stdin-stdout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Ftokio-stdin-stdout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vi","download_url":"https://codeload.github.com/vi/tokio-stdin-stdout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249061234,"owners_count":21206475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asynchronous","rust","rust-library","stdin","stdio","stdout","tokio"],"created_at":"2024-10-01T13:54:13.358Z","updated_at":"2025-04-15T11:33:06.962Z","avatar_url":"https://github.com/vi.png","language":"Rust","readme":"# tokio-stdin-stdout\nAsyncRead/AsyncWrite stdin/stdout for Tokio\n\n[Documentation](https://docs.rs/tokio-stdin-stdout) - more description there\n\n# Example\n\n```rust\nlet mut core = tokio_core::reactor::Core::new()?;\n\nlet stdin = tokio_stdin_stdout::stdin(0);\nlet stdout = tokio_stdin_stdout::stdout(0);\n\ncore.run(tokio_io::io::copy(stdin, stdout))?;\n\n```\n\n## Additional examples\n\n1. [`loop.rs`](examples/loop.rs) - Write hello ten times\n2. [`line-by-line.rs`](examples/line-by-line.rs) - Convert all input text to ASCII upper case, line by line. This example also demonstrates usage of [tokio-codec](https://docs.rs/tokio-codec) and various modes of starting Tokio programs (multithreaded, singlethreaded).\n\n\n## async fn demo\n\nNot much related to tokio-stdin-stdout, but there are some `async fn` examples runnable by [`cargo script`](https://crates.io/crates/cargo-script).\n\nThey require nightly Rust.\n\n* [loop example as async fn v1](examples2/loop_asyncfn1.rs) - The same as loop.rs above, but may be more readable.due to async fn backed by futures_await crate.\n* [line-by-line example as async fn v1](examples2/linebyline_asyncfn1.rs) - The same as line-by-line.rs, but more prodecural-looking.\n* [loop example as async fn v3](examples2/loop_asyncfn3.rs) - Another try with loop.rs, but this time using [new async engine](https://github.com/rust-lang/rfcs/blob/master/text/2394-async_await.md) built-in in Rust itself. As it intrefaces early alpha code, it may stop working after a while.\n\n# Alternatives\n\n1. [tokio-stdin](https://crates.io/crates/tokio-stdin) no AsyncRead, only stdin, byte by byte\n2. [tokio-file-unix](https://crates.io/crates/tokio-file-unix) - better, but only Unix\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Ftokio-stdin-stdout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvi%2Ftokio-stdin-stdout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Ftokio-stdin-stdout/lists"}