Trait tlbits::BitWriter

source ·
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> { ... }
}

Required Associated Types§

Required Methods§

source

fn write_bit(&mut self, bit: bool) -> Result<(), Self::Error>

Provided Methods§

source

fn write_bitslice( &mut self, bits: &BitSlice<u8, Msb0> ) -> Result<(), Self::Error>

source

fn repeat_bit(&mut self, n: usize, bit: bool) -> Result<(), Self::Error>

Implementations on Foreign Types§

source§

impl<S> BitWriter for BitVec<S, Msb0>
where S: BitStore,

§

type Error = StringError

source§

fn write_bit(&mut self, bit: bool) -> Result<(), Self::Error>

source§

fn write_bitslice( &mut self, bits: &BitSlice<u8, Msb0> ) -> Result<(), Self::Error>

source§

fn repeat_bit(&mut self, n: usize, bit: bool) -> Result<(), Self::Error>

source§

impl<W: BitWriter + ?Sized> BitWriter for &mut W

§

type Error = <W as BitWriter>::Error

source§

fn write_bit(&mut self, bit: bool) -> Result<(), Self::Error>

source§

fn write_bitslice( &mut self, bits: &BitSlice<u8, Msb0> ) -> Result<(), Self::Error>

source§

fn repeat_bit(&mut self, n: usize, bit: bool) -> Result<(), Self::Error>

source§

impl<W: BitWriter + ?Sized> BitWriter for Box<W>

§

type Error = <W as BitWriter>::Error

source§

fn write_bit(&mut self, bit: bool) -> Result<(), Self::Error>

source§

fn write_bitslice( &mut self, bits: &BitSlice<u8, Msb0> ) -> Result<(), Self::Error>

source§

fn repeat_bit(&mut self, n: usize, bit: bool) -> Result<(), Self::Error>

Implementors§

source§

impl<W> BitWriter for BitCounter<W>
where W: BitWriter,

§

type Error = <W as BitWriter>::Error

source§

impl<W> BitWriter for LimitWriter<W>
where W: BitWriter,

§

type Error = <W as BitWriter>::Error