dharitri_vm_executor/
breakpoint_value.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2pub enum BreakpointValue {
3 None = 0,
5
6 ExecutionFailed = 1,
8
9 AsyncCall = 2,
11
12 SignalError = 3,
14
15 OutOfGas = 4,
17
18 MemoryLimit = 5,
20}
21
22impl BreakpointValue {
23 pub fn as_u64(self) -> u64 {
24 self as u64
25 }
26}
27
28impl TryFrom<u64> for BreakpointValue {
29 type Error = String;
30
31 fn try_from(value: u64) -> Result<Self, Self::Error> {
32 match value {
33 0 => Ok(BreakpointValue::None),
34 1 => Ok(BreakpointValue::ExecutionFailed),
35 2 => Ok(BreakpointValue::AsyncCall),
36 3 => Ok(BreakpointValue::SignalError),
37 4 => Ok(BreakpointValue::OutOfGas),
38 5 => Ok(BreakpointValue::MemoryLimit),
39 _ => Err("unknown breakpoint".to_string()),
40 }
41 }
42}