Trait StrLookup

Source
pub trait StrLookup {
    type Key: Display;

    // Required methods
    fn insert(value: &str) -> Self::Key;
    fn get_str(key: &Self::Key) -> &str;
}
Expand description

A trait for management of str associated with StringId.

It should make link between a key (Id of a StringId) and an associated str.

Required Associated Types§

Required Methods§

Source

fn insert(value: &str) -> Self::Key

Insert the str value into lookup data, and return a corresponding unique key.

Source

fn get_str(key: &Self::Key) -> &str

Get the str corresponding do the key

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.

Implementors§

Source§

impl<KeyType, StoreType, U> StrLookup for U
where KeyType: Display + Eq + PartialEq + Hash + FromCityHash + Clone + Copy + 'static, StoreType: StaticStrStore, U: StrLookupHashMap<Key = KeyType, StrStore = StoreType>,

Source§

type Key = KeyType

Source§

impl<LookupKey> StrLookup for StrLookupEmpty<LookupKey>
where LookupKey: Display + FromCityHash,

Source§

type Key = LookupKey