Expand description
Rust bindings for the Warcraft 3 Stats Observer API memory map.
Provides safe access to the shared-memory block exported by the Warcraft III
Stats Observer API. Use ObserverHandle as the entry point — it owns the
Windows file-mapping handles and dereferences to ObserverData.
§Example
use warcraft3_stats_observer::ObserverHandle;
let observer = ObserverHandle::new()
.expect("Warcraft III not running or stats observer not available");
println!("refresh rate: {} ms", { observer.refresh_rate });§Packed structs
All structs are #[repr(C, packed)] to mirror the layout of
the underlying memory map. Reading a misaligned field by reference is
undefined behaviour, so copy fields with {} before borrowing or
formatting them:
ⓘ
println!("gold: {}", { player.gold });Structs§
- Ability
Info - State for a single hero ability slot.
- Build
Queue Info - State for a single entry in a player’s build queue.
- Hero
Info - State for a single hero owned by a player.
- Item
Info - State for a single item held in a hero’s inventory.
- Observer
Data - Top-level layout of the Warcraft III Stats Observer shared memory map.
- Observer
Game - Game-wide state exposed by the Warcraft III Stats Observer API.
- Observer
Handle - Owns the Windows handles from
OpenFileMappingWandMapViewOfFile. - Padded
String - Fixed-size, optionally NULL-terminated UTF-8 string read from the observer memory map.
- Player
Info - Per-player state — name, race, resources, and arrays of heroes, structures, units, upgrades, items, and build queue entries.
- Player
Item Info - Aggregate per-player statistics for a specific item type.
- Shop
Good Info - State for a single item offered for sale at a shop.
- Shop
Info - State for a single shop available on the map.
- Structure
Info - State for a single structure owned by a player.
- Unit
Info - Aggregate state for one unit kind owned by a player.
- Upgrade
Info - State for a single upgrade or research entry available to a player.
Enums§
- AiDifficulty
Preference - Difficulty preference selected for a computer player.
- Build
Queue Type - What kind of work a build queue entry represents.
- Player
Game Result - End-of-game result for a player.
- Player
Race - Race a player is actually playing.
- Player
Slot State - Live state of a player slot.
- Player
Type - What occupies a player slot.
- Race
Preference - Race chosen by the player in the lobby. Bit-flag encoded.
Constants§
- MAX_
GOODS - Maximum number of goods sold by a single shop.
- MAX_
HEROES - Maximum number of heroes per player tracked by the observer API.
- MAX_
ITEMS - Maximum number of distinct items collected per player.
- MAX_
PLAYERS - Maximum number of player slots tracked by the observer API.
- MAX_
SHOPS - Maximum number of shops tracked by the observer API.
- MAX_
STRUCTURES - Maximum number of structures per player tracked by the observer API.
- MAX_
UNITS - Maximum number of unit kinds per player tracked by the observer API.
- MAX_
UNITS_ IN_ QUEUE - Maximum number of in-progress build queue entries per player.
- MAX_
UPGRADES - Maximum number of upgrades per player tracked by the observer API.
- MAX_
UPKEEP_ LEVELS - Number of upkeep levels reported by the observer API.