neo3/neo_types/
plugin_type.rs

1use strum_macros::{Display, EnumString};
2
3#[derive(Display, EnumString, Debug, Copy, Clone, PartialEq, Eq)]
4#[repr(u8)]
5pub enum NodePluginType {
6	#[strum(serialize = "ApplicationLogs")]
7	ApplicationLogs,
8	#[strum(serialize = "CoreMetrics")]
9	CoreMetrics,
10	#[strum(serialize = "ImportBlocks")]
11	ImportBlocks,
12	#[strum(serialize = "LevelDBStore")]
13	LevelDbStore,
14	#[strum(serialize = "RocksDBStore")]
15	RocksDbStore,
16	#[strum(serialize = "RpcNep17Tracker")]
17	RpcNep17Tracker,
18	#[strum(serialize = "RpcSecurity")]
19	RpcSecurity,
20	#[strum(serialize = "RpcServerPlugin")]
21	RpcServerPlugin,
22	#[strum(serialize = "RpcSystemAssetTrackerPlugin")]
23	RpcSystemAssetTracker,
24	#[strum(serialize = "SimplePolicyPlugin")]
25	SimplePolicy,
26	#[strum(serialize = "StatesDumper")]
27	StatesDumper,
28	#[strum(serialize = "SystemLog")]
29	SystemLog,
30}
31
32impl NodePluginType {
33	pub fn value_of_name(name: &str) -> Result<Self, &'static str> {
34		match name.parse::<NodePluginType>() {
35			Ok(plugin_type) => Ok(plugin_type),
36			Err(_) => Err("Invalid plugin type"),
37		}
38	}
39}