{"id":15401115,"url":"https://github.com/sunfishcode/socketpair","last_synced_at":"2025-04-15T22:30:36.806Z","repository":{"id":37833991,"uuid":"329051570","full_name":"sunfishcode/socketpair","owner":"sunfishcode","description":"Cross-platform socketpair functionality","archived":false,"fork":false,"pushed_at":"2025-03-07T02:09:18.000Z","size":122,"stargazers_count":16,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T10:55:02.296Z","etag":null,"topics":["library","rust"],"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":"2021-01-12T16:49:54.000Z","updated_at":"2025-04-09T10:17:36.000Z","dependencies_parsed_at":"2023-12-28T18:32:30.564Z","dependency_job_id":"737223a1-8b4b-480e-a897-666d1d31fc5a","html_url":"https://github.com/sunfishcode/socketpair","commit_stats":{"total_commits":118,"total_committers":1,"mean_commits":118.0,"dds":0.0,"last_synced_commit":"afdee2c49ead791913e9798f9d70071ddbe6e44e"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fsocketpair","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fsocketpair/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fsocketpair/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunfishcode%2Fsocketpair/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunfishcode","download_url":"https://codeload.github.com/sunfishcode/socketpair/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703195,"owners_count":21148117,"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":["library","rust"],"created_at":"2024-10-01T15:56:31.330Z","updated_at":"2025-04-15T22:30:36.524Z","avatar_url":"https://github.com/sunfishcode.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003ccode\u003esocketpair\u003c/code\u003e\u003c/h1\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003eCross-platform socketpair functionality\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/sunfishcode/socketpair/actions?query=workflow%3ACI\"\u003e\u003cimg src=\"https://github.com/sunfishcode/socketpair/workflows/CI/badge.svg\" alt=\"Github Actions CI Status\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/socketpair\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/socketpair.svg\" alt=\"crates.io page\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/socketpair\"\u003e\u003cimg src=\"https://docs.rs/socketpair/badge.svg\" alt=\"docs.rs docs\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\nThis crate wraps [`socketpair`] with `AF_UNIX` platforms, and emulates this\ninterface using `CreateNamedPipe` on Windows.\n\nIt has a \"stream\" interface, which corresponds to `SOCK_STREAM` and\n`PIPE_TYPE_BYTE`, and a \"seqpacket\" interface, which corresponds to\n`SOCK_SEQPACKET` and `PIPE_TYPE_MESSAGE`.\n\n## Example\n\n```rust\nlet (mut a, mut b) = socketpair_stream()?;\n\nwriteln!(a, \"hello world\")?;\n\nlet mut buf = [0_u8; 4096];\nlet n = b.read(\u0026mut buf)?;\nassert_eq!(str::from_utf8(\u0026buf[..n]).unwrap(), \"hello world\\n\");\n```\n\nSupport for async-std and tokio is temporarily disabled until those crates\ncontain the needed implementations of the I/O safety traits.\n\n[`socketpair`]: https://man7.org/linux/man-pages/man2/socketpair.2.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunfishcode%2Fsocketpair","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunfishcode%2Fsocketpair","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunfishcode%2Fsocketpair/lists"}