pub trait InternerSymbol:
Sized
+ Copy
+ Hash
+ Eq {
// Required methods
fn try_from_usize(id: usize) -> Option<Self>;
fn to_usize(self) -> usize;
// Provided method
fn from_usize(id: usize) -> Self { ... }
}Expand description
Trait for types that can be used as symbols in an Interner.
Required Methods§
Sourcefn try_from_usize(id: usize) -> Option<Self>
fn try_from_usize(id: usize) -> Option<Self>
Tries to create a new Symbol from a usize.
Provided Methods§
Sourcefn from_usize(id: usize) -> Self
fn from_usize(id: 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.