pub trait Cast: Copy + Eq {
// Required methods
fn cast(self) -> usize;
fn invalid() -> Self;
}Expand description
Trait for any type that can be converted to a usize. This could
actually be a hash function, but we will assume that it is fast,
so I’m not calling it Hash.
Required Methods§
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.