+#[cfg(test)]
+pub trait Type: core::fmt::Debug + Writeable + PartialEq {
+ fn type_id(&self) -> u16;
+}
+
+#[cfg(any(feature = "_test_utils", fuzzing, test))]
+impl Type for () {
+ fn type_id(&self) -> u16 { unreachable!(); }
+}
+
+#[cfg(test)]
+impl<T: core::fmt::Debug + Writeable + PartialEq> Type for T where T: Encode {
+ fn type_id(&self) -> u16 { T::TYPE }
+}
+
+#[cfg(not(test))]