$ show mapeditor/rs-tiled
The LLM identified 3 files worth highlighting for reuse:
Defines the ResourceCache trait and DefaultResourceCache implementation. Provides a clean, reusable abstraction for caching expensive resources (tilesets, templates) during map loading. The trait is isolated (only depends on std) and can be extracted to any project needing resource caching with pluggable storage policies.
Defines the ResourceReader trait for abstracting file access. Enables loading Tiled assets from diverse sources (standard filesystem, embedded bytes, WASM virtual filesystems) without modifying core loading logic. Demonstrates the dependency inversion principle and is directly reusable in any asset-loading scenario.
Contains get_attrs! and parse_tag! macros that simplify and safeguard XML attribute extraction and element recursion when using quick-xml. These macros eliminate boilerplate, handle type conversion and errors idiomatically, and are self-contained (only depend on quick-xml types). Represent a non-obvious, reusable pattern for safe XML parsing in Rust.