Expand description
Prototype of the std::io::ensure
family of macros.
§Examples
use io_ensure::*;
use std::io::ErrorKind;
let a = 3;
let b = 1 + 2;
ensure!(a == b, ErrorKind::Other);
ensure!(a == b, ErrorKind::Interrupted, "we are testing addition with {} and {}", a, b);
Macros§
- ensure
- Exits a function early with an
io::Error
if the condition is not satisfied. - ensure_
eq - Exits a function early with an
io::Error
if two expressions are not equal to each other. - ensure_
ne - Exits a function early with an
io::Error
if two expressions are equal to each other. - format_
err - Creates an
io::Error
using optional interpolation of runtime expressions.