pub struct StmtGuard(/* private fields */);Expand description
RAII cursor accounting (Primitive #2). Mirrors the JS finally/.return()
that resets+returns the prepared statement so the next write doesn’t hit
“database is busy”. rusqlite::Rows already resets the statement on Drop;
this guard makes the release observable (and is where a real pool would
return its PooledStmt). Decrements its counter on Drop — on normal end,
early break, ?, or early return — for free, no finally needed. This is a
sqlite-only (native server) path: run the server with the release-server
profile (panic = "unwind"), where Drop also runs on panic; under a plain
release build (panic = "abort") a panic aborts the process and no destructor
runs, so panic balance holds only in unwinding builds (release-server,
cargo test). See WS02.