cfx_vm_interpreter/
vmtype.rs

1// Copyright 2015-2018 Parity Technologies (UK) Ltd.
2// This file is part of Parity.
3
4// Parity is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// Parity is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Parity.  If not, see <http://www.gnu.org/licenses/>.
16
17// Copyright 2019 Conflux Foundation. All rights reserved.
18// Conflux is free software and distributed under GNU General Public License.
19// See http://www.gnu.org/licenses/
20
21use std::fmt;
22
23/// Type of EVM to use.
24#[derive(Debug, PartialEq, Clone)]
25pub enum VMType {
26    /// RUST EVM
27    Interpreter,
28}
29
30impl fmt::Display for VMType {
31    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
32        write!(
33            f,
34            "{}",
35            match *self {
36                VMType::Interpreter => "INT",
37            }
38        )
39    }
40}
41
42impl Default for VMType {
43    fn default() -> Self { VMType::Interpreter }
44}
45
46impl VMType {
47    /// Return all possible VMs (Interpreter)
48    pub fn all() -> Vec<VMType> { vec![VMType::Interpreter] }
49}