pogo-masterfile-types 0.1.13

Generated Rust types for the Pokémon GO masterfile, with a typed parse_masterfile dispatcher.
Documentation

pogo-masterfile-types

docs.rs Crates.io

Generated Rust types for the Pokémon GO masterfile, plus a typed parse_masterfile dispatcher that returns each entry as its concrete variant.

Install

cargo add pogo-masterfile-types

Usage

use pogo_masterfile_types::{parse_masterfile, MasterfileEntry};

let json = std::fs::read_to_string("masterfile.json")?;
let entries = parse_masterfile(&json)?;

for entry in entries {
    if let MasterfileEntry::PokemonSettings(e) = entry {
        println!("{}: {:?}", e.template_id, e.data.pokemon_settings.pokemon_id);
    }
}
# Ok::<(), Box<dyn std::error::Error>>(())

What's in the crate

Each masterfile discriminator gets its own module containing three types:

  • Entry — the outer { templateId, data: { ... } } wrapper.
  • EntryData — the inner data object, with the discriminator-keyed payload field.
  • The payload type — the shape of the payload itself. Multi-shape groups are Rust enums dispatching to per-cluster variant structs.

Singletons (entries unique by templateId) live in the singletons module.

Top-level MasterfileEntry is an #[serde(untagged)] enum — feed the raw JSON to parse_masterfile and serde walks the variants until one fits.

Source

Generated from masterfile.json via the codegen pipeline at the repo root. Don't edit emitted files by hand — re-run bun run generate instead.

License

MIT — see LICENSE.