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