{"id":19198855,"url":"https://github.com/rustgd/specs-hierarchy","last_synced_at":"2025-08-21T09:32:42.296Z","repository":{"id":57668062,"uuid":"132623788","full_name":"rustgd/specs-hierarchy","owner":"rustgd","description":"A generic scene graph extension for Specs","archived":false,"fork":false,"pushed_at":"2020-07-22T23:00:38.000Z","size":66,"stargazers_count":37,"open_issues_count":2,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-06-30T14:52:39.588Z","etag":null,"topics":["ecs","rust","scene-graph"],"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/rustgd.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}},"created_at":"2018-05-08T14:49:15.000Z","updated_at":"2025-03-08T12:05:33.000Z","dependencies_parsed_at":"2022-09-07T15:50:20.794Z","dependency_job_id":null,"html_url":"https://github.com/rustgd/specs-hierarchy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rustgd/specs-hierarchy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustgd%2Fspecs-hierarchy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustgd%2Fspecs-hierarchy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustgd%2Fspecs-hierarchy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustgd%2Fspecs-hierarchy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustgd","download_url":"https://codeload.github.com/rustgd/specs-hierarchy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustgd%2Fspecs-hierarchy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271455635,"owners_count":24762764,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","rust","scene-graph"],"created_at":"2024-11-09T12:24:29.840Z","updated_at":"2025-08-21T09:32:42.012Z","avatar_url":"https://github.com/rustgd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `specs-hierarchy`\n\n[![Build Status][bi]][bl] [![Crates.io][ci]][cl] [![Gitter][gi]][gl] ![MIT/Apache][li] [![Docs.rs][di]][dl] ![LoC][lo]\n\n[bi]: https://travis-ci.org/rustgd/specs-hierarchy.svg?branch=master\n[bl]: https://travis-ci.org/rustgd/specs-hierarchy\n\n[ci]: https://img.shields.io/crates/v/specs-hierarchy.svg\n[cl]: https://crates.io/crates/specs-hierarchy/\n\n[li]: https://img.shields.io/crates/l/specs-hierarchy.svg\n\n[di]: https://docs.rs/specs-hierarchy/badge.svg\n[dl]: https://docs.rs/specs-hierarchy/\n\n[gi]: https://badges.gitter.im/slide-rs/specs.svg\n[gl]: https://gitter.im/slide-rs/specs\n\n[lo]: https://tokei.rs/b1/github/rustgd/specs-hierarchy?category=code\n\nScene graph type hierarchy abstraction for use with [`specs`].\n\nBuilds up a `Hierarchy` resource, by querying a user supplied `Parent` component.\nRequires the component to be `Tracked`.\n\nWill send modification events on an internal `EventChannel`. Note that `Removed` events\ndoes not mean the `Parent` component was removed from the component storage, just that the\n`Entity` will no longer be considered to be a part of the `Hierarchy`. This is because the user\nmay wish to either remove only the component, the complete `Entity`, or something completely\ndifferent. When an `Entity` that is a parent gets removed from the hierarchy, the full tree of\nchildren below it will also be removed from the hierarchy.\n\n[`specs`]: https://github.com/slide-rs/specs\n\n## Usage\n\n```toml\n# Cargo.toml\n[dependencies]\nspecs-hierarchy = \"0.5.1\"\n```\n\n## Example\n\n```rust\nuse specs::prelude::{Component, DenseVecStorage, Entity, FlaggedStorage};\nuse specs_hierarchy::{Hierarchy, Parent as HParent};\n\n/// Component for defining a parent entity.\n///\n/// The entity with this component *has* a parent, rather than *is* a parent.\n#[derive(Debug, Clone, Eq, Ord, PartialEq, PartialOrd)]\npub struct Parent {\n    /// The parent entity\n    pub entity: Entity,\n}\n\nimpl Component for Parent {\n    type Storage = FlaggedStorage\u003cSelf, DenseVecStorage\u003cSelf\u003e\u003e;\n}\n\nimpl HParent for Parent {\n    fn parent_entity(\u0026self) -\u003e Entity {\n        self.entity\n    }\n}\n```\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nWe are a community project that welcomes contribution from anyone. If you're interested in helping out, you can contact\nus either through GitHub, or via [`gitter`](https://gitter.im/slide-rs/specs).\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustgd%2Fspecs-hierarchy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustgd%2Fspecs-hierarchy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustgd%2Fspecs-hierarchy/lists"}