(kind: u32, message: String)
| 127 | } |
| 128 | } |
| 129 | pub fn from_kind(kind: u32, message: String) -> Self { |
| 130 | match kind { |
| 131 | 0 => Self::Type(message), |
| 132 | 1 => Self::Value(message), |
| 133 | 2 => Self::Runtime(message), |
| 134 | 3 => Self::Attribute(message), |
| 135 | 4 => Self::Index(message), |
| 136 | 5 => Self::Key(message), |
| 137 | _ => Self::Custom { kind, message }, |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | pub type Result<T> = core::result::Result<T, Error>; |