{"id":13439483,"url":"https://github.com/amethyst/specs","last_synced_at":"2025-12-12T16:36:46.720Z","repository":{"id":37549784,"uuid":"55565443","full_name":"amethyst/specs","owner":"amethyst","description":"Specs - Parallel ECS","archived":false,"fork":false,"pushed_at":"2024-06-07T18:32:55.000Z","size":2789,"stargazers_count":2564,"open_issues_count":49,"forks_count":221,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-05-10T04:33:48.481Z","etag":null,"topics":["ecs","parallel-ecs","rust"],"latest_commit_sha":null,"homepage":"https://amethyst.github.io/specs/","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":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2016-04-06T01:06:31.000Z","updated_at":"2025-05-09T21:57:17.000Z","dependencies_parsed_at":"2024-06-07T19:53:05.739Z","dependency_job_id":"cd41acb4-0c12-45a3-a6df-f0b15b3401ce","html_url":"https://github.com/amethyst/specs","commit_stats":{"total_commits":944,"total_committers":109,"mean_commits":8.660550458715596,"dds":0.8072033898305084,"last_synced_commit":"d303a8efca9077debc4f0f9c25bce62c855bbe7d"},"previous_names":["slide-rs/specs"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Fspecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Fspecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Fspecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Fspecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amethyst","download_url":"https://codeload.github.com/amethyst/specs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235701,"owners_count":22036964,"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-ecs","rust"],"created_at":"2024-07-31T03:01:14.289Z","updated_at":"2025-12-12T16:36:41.670Z","avatar_url":"https://github.com/amethyst.png","language":"Rust","readme":"# Specs\n\n\u003e **S**pecs **P**arallel **ECS**\n\n[![Build Status][bi]][bl] [![Crates.io][ci]][cl] [![Gitter][gi]][gl] ![MIT/Apache][li] [![Docs.rs][di]][dl]\n\n[bi]: https://github.com/amethyst/specs/actions/workflows/ci.yml/badge.svg?branch=master\n[bl]: https://github.com/amethyst/specs/actions/workflows/ci.yml\n\n[ci]: https://img.shields.io/crates/v/specs.svg\n[cl]: https://crates.io/crates/specs/\n\n[gi]: https://badges.gitter.im/slide-rs/specs.svg\n[gl]: https://gitter.im/slide-rs/specs\n\n[li]: https://img.shields.io/crates/l/specs.svg?maxAge=2592000\n\n[di]: https://docs.rs/specs/badge.svg\n[dl]: https://docs.rs/specs/\n\n\nSpecs is an Entity-Component System written in Rust.\nUnlike most other ECS libraries out there, it provides\n\n* easy parallelism\n* high flexibility\n    * contains 5 different storages for components, which can be extended by the user\n    * its types are mostly not coupled, so you can easily write some part yourself and\n      still use Specs\n    * `System`s may read from and write to components and resources, can depend on each\n      other and you can use barriers to force several stages in system execution\n* high performance for real-world applications\n\nMinimum Rust version: 1.70\n\n## [Link to the book][book]\n\n[book]: https://amethyst.github.io/specs/docs/tutorials/\n\n## Example\n\n```rust\nuse specs::prelude::*;\n\n// A component contains data\n// which is associated with an entity.\n#[derive(Debug)]\nstruct Vel(f32);\n\nimpl Component for Vel {\n    type Storage = VecStorage\u003cSelf\u003e;\n}\n\n#[derive(Debug)]\nstruct Pos(f32);\n\nimpl Component for Pos {\n    type Storage = VecStorage\u003cSelf\u003e;\n}\n\nstruct SysA;\n\nimpl\u003c'a\u003e System\u003c'a\u003e for SysA {\n    // These are the resources required for execution.\n    // You can also define a struct and `#[derive(SystemData)]`,\n    // see the `full` example.\n    type SystemData = (WriteStorage\u003c'a, Pos\u003e, ReadStorage\u003c'a, Vel\u003e);\n\n    fn run(\u0026mut self, (mut pos, vel): Self::SystemData) {\n        // The `.join()` combines multiple component storages,\n        // so we get access to all entities which have\n        // both a position and a velocity.\n        for (pos, vel) in (\u0026mut pos, \u0026vel).join() {\n            pos.0 += vel.0;\n        }\n    }\n}\n\nfn main() {\n    // The `World` is our\n    // container for components\n    // and other resources.\n    let mut world = World::new();\n    world.register::\u003cPos\u003e();\n    world.register::\u003cVel\u003e();\n\n    // An entity may or may not contain some component.\n\n    world.create_entity().with(Vel(2.0)).with(Pos(0.0)).build();\n    world.create_entity().with(Vel(4.0)).with(Pos(1.6)).build();\n    world.create_entity().with(Vel(1.5)).with(Pos(5.4)).build();\n\n    // This entity does not have `Vel`, so it won't be dispatched.\n    world.create_entity().with(Pos(2.0)).build();\n\n    // This builds a dispatcher.\n    // The third parameter of `with` specifies\n    // logical dependencies on other systems.\n    // Since we only have one, we don't depend on anything.\n    // See the `full` example for dependencies.\n    let mut dispatcher = DispatcherBuilder::new().with(SysA, \"sys_a\", \u0026[]).build();\n    // This will call the `setup` function of every system.\n    // In this example this has no effect since we already registered our components.\n    dispatcher.setup(\u0026mut world);\n\n    // This dispatches all the systems in parallel (but blocking).\n    dispatcher.dispatch(\u0026mut world);\n}\n```\n\nPlease look into [the examples directory](examples) for more.\n\n## Public dependencies\n\n| crate    | version                                                                                        |\n|----------|------------------------------------------------------------------------------------------------|\n| hibitset | [![hibitset](https://img.shields.io/crates/v/hibitset.svg)](https://crates.io/crates/hibitset) |\n| rayon    | [![rayon](https://img.shields.io/crates/v/rayon.svg)](https://crates.io/crates/rayon)          |\n| shred    | [![shred](https://img.shields.io/crates/v/shred.svg)](https://crates.io/crates/shred)          |\n| shrev    | [![shrev](https://img.shields.io/crates/v/shrev.svg)](https://crates.io/crates/shrev)          |\n\n## Contribution\n\nContribution is very welcome! If you didn't contribute before,\njust filter for issues with \"easy\" or \"good first issue\" label.\nPlease note that your contributions are assumed to be dual-licensed under Apache-2.0/MIT.\n","funding_links":[],"categories":["Libraries","库 Libraries","Rust","Objects - Entity, Actor","[ECS Libraries](#contents)","其他__大数据","库"],"sub_categories":["Game development","游戏开发 Game development","UI Test Automation Scripting","网络服务_其他","游戏开发"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famethyst%2Fspecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famethyst%2Fspecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famethyst%2Fspecs/lists"}