Skip to main content

from_text

Function from_text 

Source
pub fn from_text(
    toml_text: &str,
    lines: bool,
    fallback_id: &str,
    known: &[Config],
) -> Result<&'static MachineEntry, (ConfigError, Option<usize>)>
Expand description

A machine file’s TOML text, checked in full: the netlist, every key against known (the default configs of the registered machines, whose tables a machine file shares), and every value the machine and the simulation read. fallback_id names the machine where machine.id does not. lines says whether the text is the file as written, so that an error can name its line (a JSON file arrives here converted, and its lines are not these). The entry lives as long as the program. Files are read, and JSON converted, by sim_machines::load_file.