neo3/neo_types/
vm_state.rs

1use num_enum::TryFromPrimitive;
2use serde_derive::{Deserialize, Serialize};
3use strum_macros::{Display, EnumString};
4
5/// Represents the state of a virtual machine.
6#[derive(
7	Display,
8	EnumString,
9	Debug,
10	Clone,
11	Copy,
12	Hash,
13	PartialEq,
14	Eq,
15	TryFromPrimitive,
16	Serialize,
17	Deserialize,
18)]
19#[repr(u8)]
20#[serde(rename_all = "UPPERCASE")]
21pub enum VMState {
22	/// The virtual machine is in the "NONE" state.
23	#[strum(serialize = "NONE")]
24	None = 0,
25	/// The virtual machine is in the "HALT" state.
26	#[strum(serialize = "HALT")]
27	Halt = 1,
28	/// The virtual machine is in the "FAULT" state.
29	#[strum(serialize = "FAULT")]
30	Fault = 2,
31	/// The virtual machine is in the "BREAK" state.
32	#[strum(serialize = "BREAK")]
33	Break = 4,
34}
35
36impl Default for VMState {
37	fn default() -> Self {
38		// Provide a default implementation for VMState
39		VMState::None
40	}
41}