datex_core/datex_values/
error.rs

1use std::fmt;
2use crate::global::binary_codes::BinaryCode;
3use super::{Value, ValueResult};
4
5pub struct Error {
6	pub message: String
7}
8
9impl Value for Error {
10    fn to_string(&self) -> String {
11		return format!("!{}", self.message);
12    }
13
14    fn binary_operation(&self, _code: BinaryCode, _other: Box<dyn Value>) -> ValueResult {
15        todo!()
16    }
17
18    fn cast(&self, _dx_type: super::Type) -> ValueResult {
19        todo!()
20    }
21}
22
23impl fmt::Display for Error {
24    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
25        write!(f, "{}", Value::to_string(self))
26    }
27}