pub trait TypedSerialized {
type T;
// Required methods
fn new(serialized: Vec<u8>) -> Self
where Self: Sized;
fn as_slice(&self) -> &[u8] ⓘ;
fn into_vec(self) -> Vec<u8> ⓘ;
fn serialize(v: &Self::T) -> Result<Self, Error>
where Self: Sized,
Self::T: Serialize;
fn deserialize<'de>(&'de self) -> Result<Self::T, Error>
where Self::T: Deserialize<'de>;
}
Expand description
Serialization abstract with type to serialize.
Serializer implementations must implement this trait.
Required Associated Types§
Required Methods§
Sourcefn serialize(v: &Self::T) -> Result<Self, Error>
fn serialize(v: &Self::T) -> Result<Self, Error>
§Failures
- SerializationError when failed to serialize message.
Sourcefn deserialize<'de>(&'de self) -> Result<Self::T, Error>where
Self::T: Deserialize<'de>,
fn deserialize<'de>(&'de self) -> Result<Self::T, Error>where
Self::T: Deserialize<'de>,
§Failures
- DeserializationError when failed to deserialize decrypted message.