Expand description
This library exists to support the CLI and Web UI applications.
It exposes a limited API that could be utilized by other applications.
HOWEVER, its development will always be driven by the needs of the CLI and Web UI applications.
The main functionality is encompassed in Drug, Search, and SearchOutput.
Structs§
- Drug
- A struct to hold data regarding a specific Drug.
- Drug
Result - A struct to hold the results of a
Search::scan(). - Drug
Search - A struct to hold search information for a Drug Search.
- Simple
Result - A struct to hold the results of a
SimpleSearch::scan(). - Simple
Search - A struct to hold the input into a Simple Search.
- Value
Error - ValueError occurs when an invalid value was provided
Enums§
- Algorithm
- Algorithm enum
- Output
Format - The desired output format.
- Search
Output - A struct to hold the results of a
Search::scan().
Traits§
- Search
- Search trait.
Functions§
- analyze
- A function to get some nice stats about the drugs in the list.
- format
- Format the data in the desired output format.
This is used for the CLI and the web API.
The output format is determined by the
OutputFormatenum. This uses serde_json::to_string_pretty for JSONL and csv::WriterBuilder for CSV. The output is returned as a Vector of Strings. For CSV, the first row is the column headers and the vector items will need to be string-joined with a comma. - initialize_
distance - Initialize the distance function based on the selected
Algorithm - initialize_
searcher - A utility function to initialize the correct Searcher (Drug or Simple) based on user provided data.