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

A struct to hold data regarding a specific Drug.

A struct to hold the results of a Search::scan().

A struct to hold search information for a Drug Search.

A struct to hold the results of a SimpleSearch::scan().

A struct to hold the input into a Simple Search.

ValueError occurs when an invalid value was provided

Enums

Algorithm enum

The desired output format.

A struct to hold the results of a Search::scan().

Traits

Search trait.

Functions

A function to get some nice stats about the drugs in the list.

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 OutputFormat enum. 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 the distance function based on the selected Algorithm

A utility function to initialize the correct Searcher (Drug or Simple) based on user provided data.