pub trait BitWriter {
type Error: Error;
// Required method
fn write_bit(&mut self, bit: bool) -> Result<(), Self::Error>;
// Provided methods
fn write_bitslice(
&mut self,
bits: &BitSlice<u8, Msb0>
) -> Result<(), Self::Error> { ... }
fn repeat_bit(&mut self, n: usize, bit: bool) -> Result<(), Self::Error> { ... }
}