{"id":19594690,"url":"https://github.com/znx3p0/async_t","last_synced_at":"2025-04-27T15:34:12.572Z","repository":{"id":41326951,"uuid":"426379688","full_name":"znx3p0/async_t","owner":"znx3p0","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-18T03:34:40.000Z","size":28,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T01:11:14.080Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/znx3p0.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":"2021-11-09T20:38:33.000Z","updated_at":"2025-02-23T02:57:49.000Z","dependencies_parsed_at":"2022-08-10T01:54:19.647Z","dependency_job_id":null,"html_url":"https://github.com/znx3p0/async_t","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znx3p0%2Fasync_t","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znx3p0%2Fasync_t/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znx3p0%2Fasync_t/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znx3p0%2Fasync_t/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/znx3p0","download_url":"https://codeload.github.com/znx3p0/async_t/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251162869,"owners_count":21545838,"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":[],"created_at":"2024-11-11T08:44:32.236Z","updated_at":"2025-04-27T15:34:07.488Z","avatar_url":"https://github.com/znx3p0.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# async_t\n\nThis library allows for zero-cost compile-time async-traits.\nThis library needs nightly and features `generic_associated_types` and `type_alias_impl_trait` to be enabled.\nCompiling in stable will automatically use dtolnay's async_trait instead.\n\nIt supports everything a normal trait would except:\n- default async methods\n- blanket implementations\n- dynamic dispatch\n\nIt can also have problems with lifetimes where they have to be specified.\n\n```rust\n// spawn example\n\n#[async_trait]\ntrait Spawn {\n    // supports self, \u0026self, \u0026mut self and no self\n    async fn spawn() -\u003e JoinHandle\u003c()\u003e;\n}\n\n#[async_trait]\nimpl Spawn for Spawner {\n    async fn spawn() -\u003e JoinHandle\u003c()\u003e {\n        task::spawn(async {\n            // ...\n        })\n    }\n}\n\nasync fn spawn\u003cT: Spawn\u003e() -\u003e JoinHandle\u003c()\u003e {\n    T::spawn().await\n}\n\n```\n\n\n```rust\n#[async_trait]\ntrait Sleeper {\n    #[unsend]\n    async fn sleep\u003cT\u003e(t: T) -\u003e T;\n}\n\n#[async_trait]\nimpl Sleeper for () {\n    #[unsend]\n    async fn sleep\u003cT\u003e(t: T) -\u003e T {\n        task::sleep(Duration::from_secs(2)).await;\n        t\n    }\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznx3p0%2Fasync_t","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fznx3p0%2Fasync_t","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznx3p0%2Fasync_t/lists"}