Trait string_interner::Symbol
[−]
[src]
pub trait Symbol: Copy + Ord + Eq { fn from_usize(val: usize) -> Self; fn to_usize(self) -> usize; }
Represents indices into the StringInterner
.
Values of this type shall be lightweight as the whole purpose of interning values is to be able to store them efficiently in memory.
This trait allows definitions of custom Symbol
s besides
the already supported unsigned integer primitives.
Required Methods
fn from_usize(val: usize) -> Self
Creates a symbol explicitely from a usize primitive type.
Defaults to simply using the standard From
fn to_usize(self) -> usize
Creates a usize explicitely from this symbol.
Defaults to simply using the standard Into