pub trait BinarySerializer<T: Clone = ()> {
// Required method
fn write_bytes(
&self,
stream: &mut BitStreamWriter<'_>,
config: Option<&mut SerializerConfig<T>>,
) -> Result<(), SerializationError>;
// Provided method
fn to_bytes(
&self,
config: Option<&mut SerializerConfig<T>>,
) -> Result<Vec<u8>, SerializationError> { ... }
}