Skip to main content

json_with

Function json_with 

Source
pub fn json_with<T: Serialize>(
    recorder: &Recorder,
    about: &T,
) -> Result<String, SimError>
Expand description

The recorded rows as json() writes them, with about’s fields, in its order, between tool and columns: what the caller knows of the flight that the recorder doesn’t, such as the design flown or how far to trust it. A struct or a serde_json::Map keeps the order from one run to the next; a HashMap doesn’t, so the same flight could write other bytes.

§Errors

SimError::Domain for a value that isn’t finite; SimError::Unsupported for an about that isn’t a JSON object, or has a field named tool, columns or rows, which would write a key twice.