(&self)
| 116 | } |
| 117 | } |
| 118 | pub fn kind(&self) -> u32 { |
| 119 | match self { |
| 120 | Self::Type(_) => 0, |
| 121 | Self::Value(_) => 1, |
| 122 | Self::Runtime(_) => 2, |
| 123 | Self::Attribute(_) => 3, |
| 124 | Self::Index(_) => 4, |
| 125 | Self::Key(_) => 5, |
| 126 | Self::Custom { kind, .. } => *kind, |
| 127 | } |
| 128 | } |
| 129 | pub fn from_kind(kind: u32, message: String) -> Self { |
| 130 | match kind { |
| 131 | 0 => Self::Type(message), |