At the moment the Database is quite a complex data structure.
I would like to make a single static database, but I'm not sure if that fit's with the design goals of the library.
So in an effort to clarify what the design goals of the library are, I have some questions:
-
Is there a concrete use case for loading a database that's not the default?
The fn parse_with accepts a database param, is that used by the community?
- If there is no concrete case, then maybe the
Database can become a static structure represented as Rust source code
generated from the assets/PhoneNumberMetadata.xml?
-
The bincode (Vec<Meatadata>) is processed on first use (through lazy_static at time of writing) into a Database which is a composite of a RegexCache and three HashMaps.
This cache and HashMap generation has quite the runtime cost. It looks like it can be created offline and then stored as bincode. Then it's simply a matter of loading the database at runtime.
At the moment the
Databaseis quite a complex data structure.I would like to make a single static database, but I'm not sure if that fit's with the design goals of the library.
So in an effort to clarify what the design goals of the library are, I have some questions:
Is there a concrete use case for loading a database that's not the default?
The
fn parse_withaccepts adatabaseparam, is that used by the community?Databasecan become a static structure represented as Rust source codegenerated from the
assets/PhoneNumberMetadata.xml?The bincode (
Vec<Meatadata>) is processed on first use (throughlazy_staticat time of writing) into aDatabasewhich is a composite of aRegexCacheand threeHashMaps.This cache and HashMap generation has quite the runtime cost. It looks like it can be created offline and then stored as bincode. Then it's simply a matter of loading the database at runtime.