{"id":19147766,"url":"https://github.com/refcell/decolor","last_synced_at":"2025-07-11T11:37:13.082Z","repository":{"id":202954327,"uuid":"708456009","full_name":"refcell/decolor","owner":"refcell","description":"Asynchronous runtime abstractions for implicit function decoloring.","archived":false,"fork":false,"pushed_at":"2023-10-22T19:07:01.000Z","size":229,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T15:09:48.685Z","etag":null,"topics":["async","crate","library","macros","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/decolor","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/refcell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-22T16:07:22.000Z","updated_at":"2024-02-13T01:50:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"e6b25479-2742-42d7-b1c7-b27aa94aea3f","html_url":"https://github.com/refcell/decolor","commit_stats":null,"previous_names":["refcell/decolor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/refcell/decolor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fdecolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fdecolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fdecolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fdecolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refcell","download_url":"https://codeload.github.com/refcell/decolor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fdecolor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259571641,"owners_count":22878183,"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","crate","library","macros","rust"],"created_at":"2024-11-09T07:52:19.839Z","updated_at":"2025-07-11T11:37:13.055Z","avatar_url":"https://github.com/refcell.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# decolor \n\n[![Build Status]][actions]\n[![License]][mit-license]\n[![Docs]][Docs-rs]\n[![Latest Version]][crates.io]\n[![rustc 1.31+]][Rust 1.31]\n\n[Build Status]: https://img.shields.io/github/actions/workflow/status/refcell/decolor/ci.yml?branch=main\n[actions]: https://github.com/refcell/decolor/actions?query=branch%3Amain\n[Latest Version]: https://img.shields.io/crates/v/decolor.svg\n[crates.io]: https://crates.io/crates/decolor\n[rustc 1.31+]: https://img.shields.io/badge/rustc_1.31+-lightgray.svg\n[Rust 1.31]: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html\n[License]: https://img.shields.io/badge/license-MIT-7795AF.svg\n[mit-license]: https://github.com/refcell/decolor/blob/main/LICENSE.md\n[Docs-rs]: https://docs.rs/decolor/\n[Docs]: https://img.shields.io/docsrs/decolor.svg?color=319e8c\u0026label=docs.rs\n\n**Asynchronous runtime abstractions for implicit function decoloring.** Decolor is in https://github.com/refcell/decolor/labels/beta\n\n![](https://raw.githubusercontent.com/refcell/decolor/main/etc/banner.png)\n\n**[Install](#usage)**\n| [User Docs](#what-is-decolor)\n| [Crate Docs][crates.io]\n| [Reference][Docs-rs]\n| [Contributing](#contributing)\n| [License](#license)\n\n## What is decolor?\n\n`decolor` is a [procedural macro][proc-macro] crate that implements\na `#[decolor]` [attribute macro][attribute-macro] used to *\"decolor\"*\nan asynchronous rust function. Concretely, the `#[decolor]` macro\ncan be placed above an asynchronous function to safely\u003csup\u003e1\u003c/sup\u003e transform it\ninto a [\"purple\" function][purple] (a synchronous function that blocks\non asynchronous functionality internally).\n\n**1**: Constructing the `block_on()` call in this way prevents nested runtime\npanics, but calling the Handle [block_on][block-on] method itself [panics][handle-panics]\nif the provided future panics *or* if the runtime on which a timer future is called upon\nis shut down prior to completion. Additionally, the [Runtime][runtime]'s\n[`block_on`][runtime-block-on] call will [panic][runtime-panic] if it is called from within\nan asynchronous execution context.\n\n[runtime-panic]: https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html#panics\n[runtime-block-on]: https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html#method.block_on\n[runtime]: https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html#\n[block-on]: https://docs.rs/tokio/latest/tokio/runtime/struct.Handle.html#method.block_on\n[handle-panics]: https://docs.rs/tokio/latest/tokio/runtime/struct.Handle.html#panics-2\n[purple]: https://morestina.net/blog/1686/rust-async-is-colored\n[attribute-macro]: https://doc.rust-lang.org/beta/reference/procedural-macros.html#attribute-macros\n[proc-macro]: https://doc.rust-lang.org/beta/reference/procedural-macros.html\n\n## Usage\n\nAdd `decolor` as a dependency with cargo.\n\n```bash,ignore\ncargo add decolor\n```\n\nA short example for building a purple function using the\n[decolor][decolor] decorator.\n\n```rust\nuse decolor::decolor;\nuse tokio::time::{sleep, Duration};\n\n#[decolor]\nasync fn foo() -\u003e anyhow::Result\u003c()\u003e {\n    sleep(Duration::from_secs(1)).await;\n    println!(\"Hello, world!\");\n    Ok(())\n}\n\nfn main() {\n    assert!(foo().is_ok());\n}\n```\n\n## Contributing\n\nAll contributions are welcome! Experimentation is highly encouraged\nand new issues are welcome.\n\n## Troubleshooting \u0026 Bug Reports\n\nPlease check existing issues for similar bugs or\n[open an issue](https://github.com/refcell/decolor/issues/new)\nif no relevant issue already exists.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md).\nFree and open-source, forever.\n*All our rust are belong to you.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefcell%2Fdecolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefcell%2Fdecolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefcell%2Fdecolor/lists"}