{"id":22616340,"url":"https://github.com/xpepermint/async-socket-rs","last_synced_at":"2025-04-11T12:23:23.148Z","repository":{"id":62438278,"uuid":"419453685","full_name":"xpepermint/async-socket-rs","owner":"xpepermint","description":"General-purpose asynchronous socket stream.","archived":false,"fork":false,"pushed_at":"2023-01-20T23:31:43.000Z","size":29,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T08:42:39.484Z","etag":null,"topics":["async","channel","network","rust","socket"],"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/xpepermint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-20T18:53:36.000Z","updated_at":"2024-12-26T06:12:08.000Z","dependencies_parsed_at":"2023-02-12T06:46:07.633Z","dependency_job_id":null,"html_url":"https://github.com/xpepermint/async-socket-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpepermint%2Fasync-socket-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpepermint%2Fasync-socket-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpepermint%2Fasync-socket-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpepermint%2Fasync-socket-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xpepermint","download_url":"https://codeload.github.com/xpepermint/async-socket-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401365,"owners_count":21097328,"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":["async","channel","network","rust","socket"],"created_at":"2024-12-08T19:12:11.126Z","updated_at":"2025-04-11T12:23:23.128Z","avatar_url":"https://github.com/xpepermint.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# async-socket\n\nThis crate implements a general-purpose asynchronous socket.\n\nThe `Socket` implements [AsyncRead], [AsyncWrite], [Stream] and [Clone]\ntraits and thus mimics the functionality and the behaviour of the\n[TcpStream] and [UnixStream] objects. These propertis makes it a perfect\ntool for testing network activities and events.\n\n[![Documentation](https://img.shields.io/badge/-Documentation-blue?style=for-the-badge\u0026logo=Rust)](https://docs.rs/async-socket)\n[![Source](https://img.shields.io/badge/-Source-lightgrey?style=for-the-badge\u0026logo=GitHub)](https://github.com/xpepermint/async-socket-rs)\n\n#### Usage\n\n**Example:**\n\n```rust\nuse async_socket::Socket;\nuse async_std::task::spawn;\nuse futures::io::AsyncWriteExt;\nuse futures::stream::StreamExt;\n\nasync fn example() {\n    let mut stream = Socket::default();\n    let mut writer = stream.clone();\n\n    spawn(async move {\n        writer.write(b\"Hello\").await.unwrap();\n    });\n\n    while let Some(bytes) = stream.next().await {\n        // ...\n    }\n}\n```\n\n[AsyncRead]: https://docs.rs/futures/latest/futures/prelude/trait.AsyncRead.html\n[AsyncWrite]: https://docs.rs/futures/latest/futures/prelude/trait.AsyncWrite.html\n[Stream]: https://docs.rs/futures/latest/futures/prelude/trait.Stream.html\n[Clone]: https://doc.rust-lang.org/std/clone/trait.Clone.html\n[TcpStream]: https://docs.rs/async-std/latest/async_std/net/struct.TcpStream.html\n[UnixStream]: https://docs.rs/async-std/latest/async_std/os/unix/net/struct.UnixStream.html\n\nLicense: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpepermint%2Fasync-socket-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxpepermint%2Fasync-socket-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpepermint%2Fasync-socket-rs/lists"}