pub trait EntityRef:
Clone
+ Copy
+ PartialEq
+ Eq
+ PartialOrd
+ Ord
+ Hash {
// Required methods
fn new(value: usize) -> Self;
fn index(self) -> usize;
fn invalid() -> Self;
// Provided methods
fn is_valid(self) -> bool { ... }
fn is_invalid(self) -> bool { ... }
fn maybe_index(self) -> Option<usize> { ... }
}
Expand description
An index into an index-space of entities.
Required Methods§
Provided Methods§
Sourcefn is_invalid(self) -> bool
fn is_invalid(self) -> bool
Is this index an invalid index (equal to Self::invalid()
)?
Sourcefn maybe_index(self) -> Option<usize>
fn maybe_index(self) -> Option<usize>
Turn a valid index into Some(index)
, and an invalid index
into None
.
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.