pub fn code_to_result(code: i32) -> Result<()>Expand description
Convert the return code (0=OK, non-0=ERR) convention in libvips to Result
§Arguments
code- The return code from a libvips function
§Returns
A Result<()> which is Ok(()) if the code is 0, or Err(Error::Vips) with the error message otherwise.
§Example
use vips::*;
fn example() -> Result<()> {
let code = 1; // hypothetical
code_to_result(code)
}