{"id":19330015,"url":"https://github.com/amethyst/shred","last_synced_at":"2025-12-12T16:27:01.610Z","repository":{"id":37952470,"uuid":"89796787","full_name":"amethyst/shred","owner":"amethyst","description":"Shared resource dispatcher","archived":false,"fork":false,"pushed_at":"2025-02-28T19:48:22.000Z","size":619,"stargazers_count":243,"open_issues_count":7,"forks_count":65,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-14T02:57:52.735Z","etag":null,"topics":["ecs","parallel","rust","task-runner"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amethyst.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2017-04-29T16:11:02.000Z","updated_at":"2025-03-16T02:04:47.000Z","dependencies_parsed_at":"2023-07-13T22:54:42.282Z","dependency_job_id":"de4a02cd-544c-429e-ae6c-358b573108e0","html_url":"https://github.com/amethyst/shred","commit_stats":{"total_commits":420,"total_committers":41,"mean_commits":10.24390243902439,"dds":0.730952380952381,"last_synced_commit":"ad83a5694c397c9eca7b9392e29d20eb41ca8fda"},"previous_names":["slide-rs/shred"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Fshred","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Fshred/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Fshred/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Fshred/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amethyst","download_url":"https://codeload.github.com/amethyst/shred/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813786,"owners_count":21165632,"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":["ecs","parallel","rust","task-runner"],"created_at":"2024-11-10T02:33:19.135Z","updated_at":"2025-12-12T16:27:01.571Z","avatar_url":"https://github.com/amethyst.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shred - *Sh*ared *re*source *d*ispatcher\n\n[![Build Status][bi]][bl] [![Crates.io][cr]][cl] ![MIT/Apache][li] [![Docs.rs][di]][dl] ![LoC][lo]\n\n[bi]: https://github.com/amethyst/shred/actions/workflows/ci.yml/badge.svg\n[bl]: https://github.com/amethyst/shred/actions/workflows/ci.yml\n\n[cr]: https://img.shields.io/crates/v/shred.svg\n[cl]: https://crates.io/crates/shred/\n\n[li]: https://img.shields.io/badge/license-MIT%2FApache-blue.svg\n\n[di]: https://docs.rs/shred/badge.svg\n[dl]: https://docs.rs/shred/\n\n[lo]: https://tokei.rs/b1/github/amethyst/shred?category=code\n\nThis library allows to dispatch\nsystems, which can have interdependencies,\nshared and exclusive resource access, in parallel.\n\n## Usage\n\n```rust\nextern crate shred;\n\nuse shred::{DispatcherBuilder, Read, Resource, ResourceId, System, SystemData, World, Write};\n\n#[derive(Debug, Default)]\nstruct ResA;\n\n#[derive(Debug, Default)]\nstruct ResB;\n\n#[derive(SystemData)] // Provided with `shred-derive` feature\nstruct Data\u003c'a\u003e {\n    a: Read\u003c'a, ResA\u003e,\n    b: Write\u003c'a, ResB\u003e,\n}\n\nstruct EmptySystem;\n\nimpl\u003c'a\u003e System\u003c'a\u003e for EmptySystem {\n    type SystemData = Data\u003c'a\u003e;\n\n    fn run(\u0026mut self, bundle: Data\u003c'a\u003e) {\n        println!(\"{:?}\", \u0026*bundle.a);\n        println!(\"{:?}\", \u0026*bundle.b);\n    }\n}\n\nfn main() {\n    let mut world = World::empty();\n    let mut dispatcher = DispatcherBuilder::new()\n        .with(EmptySystem, \"empty\", \u0026[])\n        .build();\n    world.insert(ResA);\n    world.insert(ResB);\n\n    dispatcher.dispatch(\u0026mut world);\n}\n```\n\nPlease see [the benchmark](benches/bench.rs) for a bigger (and useful) example.\n\n### Required Rust version\n\n`1.65.0 stable`\n\n## Features\n\n* lock-free\n* no channels or similar functionality used (-\u003e less overhead)\n* allows both automated parallelization and fine-grained control\n\n## Contribution\n\nContribution is highly welcome! If you'd like another\nfeature, just create an issue. You can also help\nout if you want to; just pick a \"help wanted\" issue.\nIf you need any help, feel free to ask!\n\nAll contributions are assumed to be dual-licensed under\nMIT/Apache-2.\n\n## License\n\n`shred` is distributed under the terms of both the MIT\nlicense and the Apache License (Version 2.0).\n\nSee [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famethyst%2Fshred","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famethyst%2Fshred","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famethyst%2Fshred/lists"}