isl_rs/bindings/libisl_error.rs
1// Automatically generated by isl_bindings_generator.
2// LICENSE: MIT
3
4pub use super::Error;
5
6/// Returns errors caught in libisl values as defined in libisl.
7#[derive(Debug)]
8pub struct LibISLError {
9 kind: Error,
10 msg: String,
11}
12
13impl LibISLError {
14 pub fn new<M: Into<String>>(kind: Error, msg: M) -> Self {
15 Self { kind: kind,
16 msg: msg.into() }
17 }
18}
19
20impl std::fmt::Display for LibISLError {
21 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22 write!(f, "[{:?}] {}", self.kind, self.msg)
23 }
24}
25
26impl std::error::Error for LibISLError {}