pub trait NameMapIntern {
type Key: Borrow<Self::BorrowedKey>;
type BorrowedKey: ?Sized + TryToOwned<Owned = Self::Key>;
// Required methods
fn intern(&mut self, s: &str) -> Result<Self::Key, OutOfMemory>;
fn lookup<'a>(&'a self, s: &'a str) -> Option<TryCow<'a, Self::BorrowedKey>>;
}Expand description
A helper trait used in conjunction with NameMap to optionally intern
keys to non-strings.
Required Associated Types§
Sourcetype Key: Borrow<Self::BorrowedKey>
type Key: Borrow<Self::BorrowedKey>
The key that this interning context generates.
Sourcetype BorrowedKey: ?Sized + TryToOwned<Owned = Self::Key>
type BorrowedKey: ?Sized + TryToOwned<Owned = Self::Key>
The borrowed version of the key type.