pub trait EntityRef:
Clone
+ Copy
+ Debug
+ Hash
+ PartialEq
+ PartialOrd {
// Required methods
fn new(value: usize) -> Self;
fn as_u32(&self) -> u32;
fn as_usize(&self) -> usize;
}
Expand description
An opaque reference to an entity.
Entity references are intended to be created only internally, and using manually constructed entity references (using EntityRef::new
) may cause issues if you do
not know what you are doing.
Required Methods§
Sourcefn new(value: usize) -> Self
fn new(value: usize) -> Self
Creates an opaque reference to an entity.
Manually creating an entity reference may cause issues if you do not know what you are doing. Entity references are unchecked for performance reasons, and your program may panic if you create an invalid entity reference.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.