pub unsafe trait Idx:
Copy
+ Ord
+ Hashwhere
Self: Debug,{
// Required methods
fn as_usize(self) -> usize;
fn from_usize(i: usize) -> Option<Self>;
fn zero() -> Self;
fn add(self, increment: usize) -> Self;
fn sub(self, decrement: usize) -> Self;
}Expand description
Unsigned integers able to be used as a trusted index.
Required Methods§
fn as_usize(self) -> usize
fn from_usize(i: usize) -> Option<Self>
fn zero() -> Self
fn add(self, increment: usize) -> Self
fn sub(self, decrement: usize) -> Self
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.