Expand description
A simple counter for debugging.
Basic usage of the crate is calling pass
, with each
call incrementing a static counter. The counter starts at 0, and
has a max of usize::MAX
.
§Examples
Run without arguments to get basic debug information:
pass!(); // Stderr: [<count>][<line_number>]
You can pass a literal to have it printed:
// Stderr: [<count>][<line_number>] Special message
pass!("Special message");
// Stderr: [<count>][<line_number>] a
pass!('a');
// Stderr: [<count>][<line_number>] 5999999
pass(5999999);
You can pass a variable with the Display
trait too:
let hw = String::from("Hello world");
let num = 5;
// Stderr: [<count>][<line_number>] Hello world
pass!(hw);
// Stderr: [<count>][<line_number>] 5
pass!(num);
Macros§
- pass
- Prints count information to stderr.
Functions§
- current_
count - Get the current counter number without incrementing. The lowest number this function can return is 0.
- increment
- Increment counter, return the result.
- reset_
counter - Resets the counter back to 0.