{"repo":"joseph-gio/bevy-trait-query","free":true,"listed":false,"github":"https://github.com/joseph-gio/bevy-trait-query","clone":"git clone https://github.com/joseph-gio/bevy-trait-query.git","description":"adds trait queries to the bevy game engine","language":"Rust","stars":129,"topics":["bevy-engine","bevy-plugin","game-development","rust"],"license":"Apache-2.0","category":"game-templates","readme_excerpt":"bevy-trait-query An implementation of trait queries for the bevy game engine. Before using this crate, you should be familiar with bevy: https://bevyengine.org/. Bevy Version Crate Version -------------- --------------- Preview Main branch 0.18 0.18 0.17 0.17 0.16 0.16 0.15 0.7 0.14 0.6 0.13 0.5 0.12 0.4 0.11 0.3 0.10 0.2 0.9 0.1 0.8 0.0.3 Since version 0.16, we're following bevy's versions. Make sure the crate versions match! Note on reliability While this crate has seen some use in the world with no issues yet, it is still quite new and experimental. Use with caution (and miri!). If you find a bug, please open an issue. Overview Let's say you have a trait that you want to implement for some of your components. In order to be useful within bevy, you'll want to be able to query for this trait. Since Rust unfortunately lacks any kind of reflection, it is necessary to register each component with the trait when the app gets built. Unlike queries for concrete types, it's possible for an entity to have multiple components that match a trait query. Alternatively, if you expect to only have component implementing the trait for each entity, you can use the filter One . This has significantly better performance than iterating over all trait impls. Trait queries support basic change detection filtration. - queries requesting shared access yield ReadTraits which is similar to Ref - queries requesting exclusive access yield WriteTraits which is similar to Mut To get all the components t","default_branch":null,"files":null,"tree":[],"storefront":"/r/joseph-gio","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/joseph-gio/bevy-trait-query/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}