[][src]Function lark_intern::intern_impl

pub fn intern_impl<Data, Interners, EquivData: ?Sized, TableData>(
    data: Data,
    interners: &dyn AsRef<Interners>,
    to_lookup_data: impl FnOnce(&Data) -> &EquivData,
    to_table_data: impl FnOnce(Data) -> TableData
) -> TableData::Key where
    EquivData: Equivalent<TableData> + Hash,
    TableData: InternDirect<Interners>, 

Helper for Intern implementations: interns data into table, returning the intern key. Note that the data stored in table is of type TableData, which may not be the same as Data -- the convert closure will be used to convert Data into TableData as needed.