macro_rules! igraph_call {
($call:expr) => { ... };
}Expand description
Calls an igraph function returning an igraph_error_t and converts the
outcome into a Result<()>, making sure the calling thread is
initialized first (see ensure_init).
use igraph::{ffi, igraph_call};
let mut v = std::mem::MaybeUninit::<ffi::igraph_vector_int_t>::uninit();
igraph_call!(ffi::igraph_vector_int_init(v.as_mut_ptr(), 3)).unwrap();
let v = unsafe { v.assume_init() }; // dropped (and destroyed) at scope exit
assert_eq!(v.len(), 3);