pub struct FactorioExporter<'a> { /* private fields */ }
Expand description

Main class for orchestrating the export.

Implementations

Creates and configures a new FactorioExporter instance.

Arguments
  • factorio_binary - File system path of a Factorio binary. This can be any variant of the binary, full, headless, or demo.
  • api - The definition of the Factorio API, as loaded by load_api.
  • locale - Locale code to use for translated strings.
  • export_icons - Whether icon paths should be collected in the data phase and patched into the prototype definitions using a heuristic.

Export the prototype definitions from Factorio and partially deserialize them into a serde_yaml::Value object, which can easily deserialized of serialized into other data types further.

This function executes Factorio twice, once to create a save file, and a second time to execute an exporter mod that does the heavy-lifting. The process uses a temporary directory, so that the main Factorio installation is not touched. Any existing Factorio configuration, including installed mods are therefore ignored.

Install mods into the temporary execution directory before exporting. This allows exporting additional items, recipes, and all other changes that the mods make to be part of the export.

No particular checks are made that the dependencies of the specified mods can be resolved. This is the responsibility of the caller. Otherwise Factorio will probably not start.

Arguments
  • mods - A list of file system paths that point to Factorio mods in .zip format.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more