use std::any::Any;
use crate::error::SerdeError;
pub trait SerializerProtocol: Send + Sync {
fn dumps_typed(&self, obj: &dyn Any) -> Result<(String, Vec<u8>), SerdeError>;
fn loads_typed(&self, tag: &str, data: &[u8]) -> Result<Box<dyn Any>, SerdeError>;
}
pub trait UntypedSerializerProtocol: Send + Sync {
fn dumps(&self, obj: &dyn Any) -> Result<Vec<u8>, SerdeError>;
fn loads(&self, data: &[u8]) -> Result<Box<dyn Any>, SerdeError>;
}
pub trait CipherProtocol: Send + Sync {
fn encrypt(&self, plaintext: &[u8]) -> Result<(String, Vec<u8>), SerdeError>;
fn decrypt(&self, cipher_name: &str, ciphertext: &[u8]) -> Result<Vec<u8>, SerdeError>;
}