1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[cfg(feature = "aes")]
pub mod aes;
#[cfg(feature = "xor")]
pub mod xor;

pub trait EncryptedPayload: Payload {
    type Key;
    type InnerPayload: Payload;
    fn decrypt(self, key: &Self::Key) -> Self::InnerPayload;
}
impl<T: EncryptedPayload> Payload for T {}

pub type RawPayload = Vec<u8>;
pub trait Payload: From<RawPayload> {}