diff --git a/src/message.rs b/src/message.rs index 5c3f400..3be60c2 100644 --- a/src/message.rs +++ b/src/message.rs @@ -1,7 +1,6 @@ //! Messages use super::*; use std::marker::PhantomData; -use serde::{Serialize, Deserialize}; use cryptohelpers::{ sha256, aes, diff --git a/src/message/value.rs b/src/message/value.rs index 536d157..33d3632 100644 --- a/src/message/value.rs +++ b/src/message/value.rs @@ -1,5 +1,6 @@ //! Message values use super::*; +use serde::{Serialize, Deserialize}; /// A value that can be used for messages. pub trait MessageValue: Serialize + for<'de> Deserialize<'de>{} @@ -24,3 +25,9 @@ pub struct MessageValueAny(Box); //impl MessageValue for DynamicMessageValue //where T: Serialize + for<'de> Deserialize<'de> + Any{} */ + +/// A type-unsafe `MessageValue` that can be used to transmute `SerializedMessage` instances. +/// +/// This operation is unsafe and can result in deserializing the `SerializedMessage` failing, or even worse, a type confusion. +#[derive(Debug, Serialize, Deserialize)] +pub enum UntypedMessageValue{}