pub trait SerializerType {
type S;
// 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::S) -> Result<Self, SerdeVaultError>
where Self: Sized,
Self::S: Serialize;
fn deserialize<'de>(&'de self) -> Result<Self::S, SerdeVaultError>
where Self::S: Deserialize<'de>;
}
Expand description
Serialization abstract with type to serialize.
Serializer implementations must implement this trait.
Required Associated Types§
Required Methods§
fn new(serialized: Vec<u8>) -> Selfwhere
Self: Sized,
Sourcefn serialize(v: &Self::S) -> Result<Self, SerdeVaultError>
fn serialize(v: &Self::S) -> Result<Self, SerdeVaultError>
§Failures
- SerdeVaultError when failed to serialize message.
Sourcefn deserialize<'de>(&'de self) -> Result<Self::S, SerdeVaultError>where
Self::S: Deserialize<'de>,
fn deserialize<'de>(&'de self) -> Result<Self::S, SerdeVaultError>where
Self::S: Deserialize<'de>,
§Failures
- SerdeVaultError when failed to deserialize decrypted message.