I need to create a string
to string
map with flatbuffers in Rust similar to:
pub struct HashMapIndex {
keyword_by_filter: HashMap<String, String> // filter text -> keyword
}
I've found some key
flatbuffers attribute that can be put on array item, but it seems to be neither documented nor shown in samples:
Can be used for in-place binary search
table KeywordToFilters {
filter_text: string (key);
keyword: string;
}
table Index {
map: [KeywordToFilters];
}
How can i use it (get value by key)? The problem is that no map-like methods are generated - it's just a vector:
pub map: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<KeywordToFilters<'a >>>>>,
Is there more efficient way to have a map with flatbuffers in Rust?
PS. flatbuffers crate version is 0.8.3