This example is a small program that shows how use user defined events and metrics.
First, we define our own UserRules
, a custom event MakePizza
. Then we create a server
and fire two MakePizza
events.
Before exiting, the program prints to the terminal the json serialized content of the battle history.
Run the example with:
cargo run --example user-event --all-features
The program is implemented in two source code files: