Macro wrap_error

Source
macro_rules! wrap_error {
    ($(#[$meta: meta])* $name: ident ($inner: ty)$(;)?) => { ... };
}
Expand description

Wraps an external error type in a newtype struct so it can be used with py_wrap_error.

§Implements

  • From impls between the newtype and the inner type.
  • Display delegating to the inner type
  • Error

§Example

use rigetti_pyo3::{wrap_error, py_wrap_error};
use rigetti_pyo3::pyo3::exceptions::PyRuntimeError;

wrap_error!{
    RustIOError(std::io::Error);
}

py_wrap_error!(errors, RustIOError, IOError, PyRuntimeError);