A small example how to dump your struct to a file and read it again.
in case you are using a gui library like libui you can then bundle the libui.A.dylib with your app bundle.
cargo bundle is recommended for packaging the actual app.
cargo build will then build both. Run the binary of your choice with cargo run --bin cli.
If you use this in your crate root, no console window will be shown if you run the resulting executable.