pub trait Serializer {
type Error;
// Required methods
fn name() -> &'static str;
fn version() -> i32;
fn serialize(
buffer: &mut impl Write,
header: &Header,
root: &Element,
) -> Result<(), Self::Error>;
fn deserialize(
buffer: &mut impl BufRead,
encoding: String,
version: i32,
) -> Result<Element, Self::Error>;
}
Expand description
A trait for serializing and deserializing elements.
Required Associated Types§
Required Methods§
fn serialize( buffer: &mut impl Write, header: &Header, root: &Element, ) -> Result<(), Self::Error>
fn deserialize( buffer: &mut impl BufRead, encoding: String, version: i32, ) -> Result<Element, Self::Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.