lemma/
operation_result.rs1use crate::semantic::LiteralValue;
2
3#[derive(Debug, Clone, PartialEq)]
5pub enum OperationResult {
6 Value(LiteralValue),
8 Veto(Option<String>),
10}
11
12impl OperationResult {
13 pub fn is_vetoed(&self) -> bool {
15 matches!(self, OperationResult::Veto(_))
16 }
17
18 pub fn value(&self) -> Option<&LiteralValue> {
20 match self {
21 OperationResult::Value(v) => Some(v),
22 OperationResult::Veto(_) => None,
23 }
24 }
25
26 pub fn veto_message(&self) -> Option<&Option<String>> {
28 match self {
29 OperationResult::Veto(msg) => Some(msg),
30 OperationResult::Value(_) => None,
31 }
32 }
33}