Thanks to visit codestin.com
Credit goes to lib.rs

#ecs #entity

no-std gloss-hecs

A wrapper over hecs for easy use with gloss

7 unstable releases (3 breaking)

0.8.0 Nov 18, 2025
0.7.0 Aug 5, 2025
0.6.0 Apr 30, 2025
0.5.3 Mar 17, 2025

#1028 in Game dev


Used in 5 crates (2 directly)

MIT/Apache

310KB
5.5K SLoC

Gloss Hecs

A small wrapper around hecs with convenience functions for easy use with gloss.


lib.rs:

A handy ECS

hecs provides a high-performance, minimalist entity-component-system (ECS) world. It is a library, not a framework. In place of an explicit "System" abstraction, a World's entities are easily queried from regular code. Organize your application however you like!

In order of importance, hecs pursues:

  • fast traversals
  • a simple interface
  • a small dependency closure
  • exclusion of externally-implementable functionality
let mut world = World::new();
// Nearly any type can be used as a component with zero boilerplate
let a = world.spawn((123, true, "abc"));
let b = world.spawn((42, false));
// Systems can be simple for loops
for (id, (mut number, &flag)) in world.query_mut::<(&mut i32, &bool)>() {
    if flag {
        *number *= 2;
    }
}
// Random access is simple and safe
assert_eq!(*world.get::<&i32>(a).unwrap(), 246);
assert_eq!(*world.get::<&i32>(b).unwrap(), 42);

Dependencies

~60–98MB
~1.5M SLoC