Registry / utility / cranelift-entity

cranelift-entity

JSON →
library0.132.2rscratesunverified

Provides data structures that use entity references as mapping keys, such as EntityMap and SecondaryMap.

# Cargo.toml [dependencies] cranelift-entity = "0.132.2"
INSTALL
IMPORT
SIG · CRANELIFT-ENTITY
C
cranelift-entity
utilityrustv0.132.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EntityRef
use cranelift_entity::EntityRef;

Implement EntityRef for a custom entity type.

use cranelift_entity::EntityRef; #[derive(Copy, Clone, PartialEq, Eq)] struct MyEntity(u32); impl EntityRef for MyEntity { fn new(index: usize) -> Self { MyEntity(index as u32) } fn index(self) -> usize { self.0 as usize } } fn main() { let e = MyEntity::new(0); println!("Entity index: {}", e.index()); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.132.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
cranelift-entity — cargo add cranelift-entity · libregistry