Function load_api

Source
pub fn load_api(api_file_path: &Path) -> Result<Api>
Expand description

Loads the API definition from the definition file

This file is usually called runtime-api.json and can be found in the factorio/doc-html directory of a full (not headless or demo) Factorio installation, or on the API website. Its content can be browsed in a nice format as well.

§Arguments

  • api_file_path - File system path to read the API definition from.

§Example

use factorio_exporter::{ load_api, FactorioExporterError };
use std::path::PathBuf;

let api_spec = PathBuf::from("/home/user/factorio/doc-html/runtime-api.json");
let api = load_api(&api_spec)?;