Skip to main content

parse_exchange

Function parse_exchange 

Source
pub fn parse_exchange(
    filename: &str,
    bytes: &[u8],
) -> Result<Vec<ResultInput>, String>
Expand description

Reads teamcraft-results.json or teamcraft-results.csv.

JSON: an array of results, or an object {"results": [...]}. Every result has name (text) and value (number); optional unit, limit_min, limit_max (numbers or null), load_case, solver, solver_version and note. Unknown keys are refused.

CSV: a header row with name,value,unit,limit_min,limit_max,load_case (further columns solver, solver_version, note), one result per row.

A file that is too large, malformed or has a wrong field is an error with the place of the problem (JSON path or row); nothing is half-read.