{"id":15401117,"url":"https://github.com/sunfishcode/io-streams","last_synced_at":"2025-04-05T14:04:54.306Z","repository":{"id":38688472,"uuid":"321708054","full_name":"sunfishcode/io-streams","owner":"sunfishcode","description":"Unbuffered and unlocked I/O streams","archived":false,"fork":false,"pushed_at":"2025-03-07T01:41:45.000Z","size":193,"stargazers_count":45,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T13:06:27.495Z","etag":null,"topics":["descriptor","pipes","rust","sockets","streams"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunfishcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-15T15:24:31.000Z","updated_at":"2025-03-07T01:41:49.000Z","dependencies_parsed_at":"2024-10-20T11:17:49.101Z","dependency_job_id":null,"html_url":"https://github.com/sunfishcode/io-streams","commit_stats":{"total_commits":142,"total_committers":2,"mean_commits":71.0,"dds":0.007042253521126751,"last_synced_commit":"85f1a89ced3d68cf7bbc2c0cd347ee9c865d2ab9"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fio-streams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fio-streams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fio-streams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fio-streams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunfishcode","download_url":"https://codeload.github.com/sunfishcode/io-streams/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345850,"owners_count":20924102,"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":["descriptor","pipes","rust","sockets","streams"],"created_at":"2024-10-01T15:56:31.782Z","updated_at":"2025-04-05T14:04:54.281Z","avatar_url":"https://github.com/sunfishcode.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003ccode\u003eio-streams\u003c/code\u003e\u003c/h1\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003eUnbuffered and unlocked I/O streams\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/sunfishcode/io-streams/actions?query=workflow%3ACI\"\u003e\u003cimg src=\"https://github.com/sunfishcode/io-streams/workflows/CI/badge.svg\" alt=\"Github Actions CI Status\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/io-streams\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/io-streams.svg\" alt=\"crates.io page\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/io-streams\"\u003e\u003cimg src=\"https://docs.rs/io-streams/badge.svg\" alt=\"docs.rs docs\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\nThis crate defines [`StreamReader`], [`StreamWriter`], and [`StreamDuplexer`]\ntypes which provide safe, owning, unbuffered, and unlocked access to a raw I/O\nstream, such as standard input, standard output, files, sockets, pipes, or\ncharacter devices. It also supports a \"piped thread\" concept, where an\narbitrary `Box\u003cdyn Read + Send\u003e` or `Box\u003cdyn Write + Send\u003e` can be provided,\nand the I/O is performed on a thread and connecting to the `StreamReader` or\n`StreamWriter` with a [pipe], and a \"socketed thread\" concept, where a provided\nfunction is called on a thread and connected to the main thread via a\nbidirectional socket.\n\nThis crate also defines [`AsyncStreamReader`], [`AsyncStreamWriter`], and\n[`AsyncStreamDuplexer`], which are async functions that work with `async-std`.\nAnd [`TokioStreamReader`], [`TokioStreamWriter`], and [`TokioStreamDuplexer`],\nwhich are async functions that work with `tokio`. Not all features are\nsupported yet, and they aren't fully optimized yet, but basic file and socket\nsupport is in place.\n\nOn Posix-ish platforms, including limited support for WASI, these types just\ncontain a single file descriptor (and implement [`AsFd`]), plus any\nresources needed to safely hold the file descriptor live. On Windows, they\ncontain an enum holding either `RawHandle` or `RawSocket`.\n\nSince these types are unbuffered, it's advisable for most use cases to wrap\nthem in buffering types such as [`std::io::BufReader`], [`std::io::BufWriter`],\n[`std::io::LineWriter`], [`io_streams::BufDuplexer`], or\n[`io_streams::BufReaderLineWriter`].\n\nRust's [`std::io::Stdin`] and [`std::io::Stdout`] are always buffered, while\nits [`std::fs::File`] and [`std::net::TcpStream`] are unbuffered. A key purpose\nof the `io_streams` crate is to abstract over the underlying inputs and outputs\nwithout adding buffering, so that buffering can be applied without redundancy.\n\nThis crate locks `stdio::io::Stdin` and `std::io::Stdout` while it has their\ncorresponding streams open, to prevent accidental mixing of buffered and\nunbuffered output on the same stream. Attempts to use the buffered streams when\nthey are locked will block indefinitely.\n\nSupport for async-std and tokio in char-device and socketpair is temporarily\ndisabled until those crates contain the needed implementations of the\nI/O safety traits.\n\n[`StreamReader`]: https://docs.rs/io-streams/latest/io_streams/struct.StreamReader.html\n[`StreamWriter`]: https://docs.rs/io-streams/latest/io_streams/struct.StreamWriter.html\n[`StreamDuplexer`]: https://docs.rs/io-streams/latest/io_streams/struct.StreamDuplexer.html\n[`AsyncStreamReader`]: https://docs.rs/io-streams/latest/io_streams/struct.AsyncStreamReader.html\n[`AsyncStreamWriter`]: https://docs.rs/io-streams/latest/io_streams/struct.AsyncStreamWriter.html\n[`AsyncStreamDuplexer`]: https://docs.rs/io-streams/latest/io_streams/struct.AsyncStreamDuplexer.html\n[`TokioStreamReader`]: https://docs.rs/io-streams/latest/io_streams/struct.TokioStreamReader.html\n[`TokioStreamWriter`]: https://docs.rs/io-streams/latest/io_streams/struct.TokioStreamWriter.html\n[`TokioStreamDuplexer`]: https://docs.rs/io-streams/latest/io_streams/struct.TokioStreamDuplexer.html\n[`io_streams::BufDuplexer`]: https://docs.rs/io-streams/latest/io_streams/struct.BufDuplexer.html\n[`io_streams::BufReaderLineWriter`]: https://docs.rs/io-streams/latest/io_streams/struct.BufReaderLineWriter.html\n[`std::io::Stdin`]: https://doc.rust-lang.org/std/io/struct.Stdin.html\n[`std::io::Stdout`]: https://doc.rust-lang.org/std/io/struct.Stdout.html\n[`std::io::BufReader`]: https://doc.rust-lang.org/std/io/struct.BufReader.html\n[`std::io::BufWriter`]: https://doc.rust-lang.org/std/io/struct.BufWriter.html\n[`std::io::LineWriter`]: https://doc.rust-lang.org/std/io/struct.LineWriter.html\n[`AsFd`]: https://docs.rs/io-lifetimes/0.2.0/io_lifetimes/trait.AsFd.html\n[pipe]: https://crates.io/crates/os_pipe\n[`std::fs::File`]: https://doc.rust-lang.org/std/fs/struct.File.html\n[`std::net::TcpStream`]: https://doc.rust-lang.org/std/net/struct.TcpStream.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunfishcode%2Fio-streams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunfishcode%2Fio-streams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunfishcode%2Fio-streams/lists"}