Trait serde_encrypt::serialize::TypedSerialized
source · [−]pub trait TypedSerialized {
type T;
fn new(serialized: Vec<u8>) -> Self
where
Self: Sized;
fn as_slice(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [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
Ref to serialized.
Failures
- SerializationError when failed to serialize message.
fn 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.