ferroui_base/rendering/composition/expressions/
expression_parse_exception.rs1use std::error::Error;
4use std::fmt;
5
6#[derive(Clone, Debug, PartialEq, Eq)]
8pub struct ExpressionParseException {
9 message: String,
10 position: i32,
11}
12
13impl ExpressionParseException {
14 pub fn new(message: impl Into<String>, position: i32) -> Self {
17 Self {
18 message: message.into(),
19 position,
20 }
21 }
22
23 pub fn message(&self) -> &str {
25 &self.message
26 }
27
28 pub fn position(&self) -> i32 {
30 self.position
31 }
32}
33
34impl fmt::Display for ExpressionParseException {
35 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
36 f.write_str(&self.message)
37 }
38}
39
40impl Error for ExpressionParseException {}