1use solomon_gremlin::GValue;
2use thiserror::Error;
3
4#[allow(clippy::large_enum_variant)]
5#[derive(Debug, Error)]
6pub enum InstructionError {
7 #[error("Cast error: {0}")]
8 Cast(String),
9}
10
11#[derive(Debug, Clone, PartialEq)]
12pub struct IxResult {
13 pub operator: String,
14 pub value: GValue,
15}
16
17impl Default for IxResult {
18 fn default() -> Self {
19 IxResult::new("", GValue::Null)
20 }
21}
22
23impl IxResult {
24 pub fn is_empty(&self) -> bool {
25 self.operator.is_empty() && matches!(&self.value, GValue::Null)
26 }
27
28 pub fn new(operator: &str, value: GValue) -> Self {
29 IxResult {
30 operator: String::from(operator),
31 value,
32 }
33 }
34}