aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 8f98366..0c0870b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,6 +4,7 @@ extern crate termion;
extern crate serde;
use std::str::FromStr;
+use std::hash::Hash;
use std::fmt::{Debug, Display, Formatter};
@@ -165,14 +166,14 @@ pub trait Decodable where Self: Sized {
#[cfg(feature="use-serde")]
pub trait Arch {
- type Address: Address + Debug + Serialize + for<'de> Deserialize<'de>;
+ type Address: Address + Debug + Hash + PartialEq + Eq + Serialize + for<'de> Deserialize<'de>;
type Instruction: Decodable + LengthedInstruction<Unit=Self::Address> + Debug;
type Operand;
}
#[cfg(not(feature="use-serde"))]
pub trait Arch {
- type Address: Address + Debug;
+ type Address: Address + Debug + Hash + PartialEq + Eq;
type Instruction: Decodable + LengthedInstruction<Unit=Self::Address> + Debug;
type Operand;
}
@@ -183,6 +184,15 @@ pub trait LengthedInstruction {
fn min_size() -> Self::Unit;
}
+#[cfg(feature="use-serde")]
+impl Serialize for ColorSettings {
+ fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
+ use serde::ser::SerializeStruct;
+ let mut s = serializer.serialize_struct("ColorSettings", 0)?;
+ s.end()
+ }
+}
+
pub struct ColorSettings {
arithmetic: color::Fg<&'static color::Color>,
stack: color::Fg<&'static color::Color>,