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 Symbols besides the already supported unsigned integer primitives.

Required Methods

Creates a symbol explicitely from a usize primitive type.

Defaults to simply using the standard From trait.

Creates a usize explicitely from this symbol.

Defaults to simply using the standard Into trait.

Implementors