Expand description
A library and binary for exporting object prototype definitions from Factorio in JSON or YAML.
Usage:
use factorio_exporter::{ load_api, FactorioExporter, FactorioExporterError, Result };
use std::path::PathBuf;
let api_spec = PathBuf::from("/home/user/factorio/doc-html/runtime-api.json");
let factorio_binary = PathBuf::from("/home/user/factorio/bin/x64/factorio");
let api = load_api(&api_spec)?;
let exporter = FactorioExporter::new(&factorio_binary, &api, "en", true)?;
let result: serde_yaml::Value = exporter.export()?;
The result is returned as a serde_yaml::Value
object, which can easily
deserialized of serialized into other data types further. See this example
to see the structure that the data has.
Structs§
- Factorio
Exporter - Main class for orchestrating the export.
Enums§
- Factorio
Exporter Error - Main error type used throughout factorio-explorer
Functions§
- load_
api - Loads the API definition from the definition file
Type Aliases§
- Result
- Main result type used throughout factorio-explorer