1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// SPDX-License-Identifier: MIT // Copyright 2024 IROX Contributors // use crate::{Bits, Error}; /// /// Buffered bits - semantically equivalent to BufRead pub trait BufBits: Bits { fn fill_buf(&mut self) -> Result<&[u8], Error>; fn consume(&mut self, amt: usize); fn has_data_left(&mut self) -> Result<bool, Error> { self.fill_buf().map(|b| !b.is_empty()) } }