Lookups


Improve the data retrieval operations for collections.
Overview
lookups is a crate for extending already existing collections (std::vec::Vec, std::collections::HashMap, ...)
with additional lookup functionalities, so you have a faster access to your data as with an iterator or a search algorithm.
This wrapper is just as easy to use as the given (original) collection.
The fast access can be achieved by using different methods, like;
- hash tables
- indexing
- ...
Disadvantage
- it is more memory required. In addition to the user data, data for the hash, index are also stored.
- the write operation are slower, because for every wirte operation is an another one (for storing the lookup data) necessary
How can I use it?
use ;
// create a new Lookup HashMap: LkupMap with a UniquePosIndex
let mut map = new;
map.insert;
map.insert;
map.insert;
// conventionally HashMap access with Key (name: String)
assert!;
// lookup with Key (id: usize)
assert!;
// get a Car by an given Key
assert_eq!;
assert_eq!;
// create a View: a subset from the Lookups (defined by the given Keys)
let view = map.create_lkup_view;
assert_eq!;
assert_eq!;