main function, a CLI script, a benchmark harness, or any other code that runs outside of #[dbg_test].
Setup
Adddbgflow to your Cargo.toml:
capture, capture_to_file, capture_and_serve, and all instrumentation macros (#[trace], #[ui_debug], #[dbg_test]).
dbgflow::capture
dbgflow::save_current_session afterward if you want to persist it.
Parameters
Returns
T — the return value of the closure.
Example
capture resets any previously active session. If you need to keep an existing session, retrieve it with dbgflow::current_session() before calling capture.dbgflow::capture_to_file
Returns
std::io::Result<T> — Ok(result) on success, or an Err if writing the file fails.
Example
dbgflow::capture_and_serve
Returns
std::io::Result<T> — Ok(result) on success, or an Err if starting the server fails. The call blocks until you stop the server.
Example
capture_and_serve blocks the current thread while the server is running. Use it in standalone binaries or scripts, not in library code that should return promptly.