1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use crate::value::Value;
use std::result;
#[derive(Debug)]
pub struct Runtime {
pub message: String,
}
impl Runtime {
pub fn new<S: Into<String>>(message: S) -> Self {
Self {
message: message.into(),
}
}
}
#[macro_export]
macro_rules! runtime {
($fmt:expr) => {
$crate::Runtime::new($fmt)
};
($fmt: expr, $( $args:expr ),*) => {
$crate::Runtime::new(format!( $fmt, $( $args, )* ))
};
}
pub type DMResult<T = Value> = result::Result<T, Runtime>;