pub trait HandleCore:
Clone
+ Copy
+ Eq
+ PartialEq
+ Hash
+ Debug
+ Ord
+ PartialOrd {
// Required methods
fn into_index(self) -> usize;
fn from_index(index: usize) -> Self;
}
Expand description
A type that may serve as the internal representation of a Handle.
A Handle is defined by a single field known as its core. The core identifies the handled
object, and is an instance of a lightweight type that implements HandleCore. It should
be convertible from and to a usize
, which represents the handled object’s serial-number.
Required Methods§
Sourcefn into_index(self) -> usize
fn into_index(self) -> usize
Get the serial number represented by this HandleCore.
Sourcefn from_index(index: usize) -> Self
fn from_index(index: usize) -> Self
Transform a serial number into an identifying HandleCore.
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.