pub struct UnalignedBitChunk<'a> { /* private fields */ }Expand description
Iterates over an arbitrarily aligned byte buffer
Yields an iterator of aligned u64, along with the leading and trailing u64 necessary to align the buffer to a 8-byte boundary
This is unlike BitChunkIterator which only exposes a trailing u64,
and consequently has to perform more work for each read
Implementations§
§impl<'a> UnalignedBitChunk<'a>
impl<'a> UnalignedBitChunk<'a>
pub fn new(buffer: &'a [u8], offset: usize, len: usize) -> UnalignedBitChunk<'a>
pub fn new(buffer: &'a [u8], offset: usize, len: usize) -> UnalignedBitChunk<'a>
Create a from a byte array, and and an offset and length in bits
pub fn lead_padding(&self) -> usize
pub fn trailing_padding(&self) -> usize
pub fn prefix(&self) -> Option<u64>
pub fn suffix(&self) -> Option<u64>
pub fn chunks(&self) -> &'a [u64]
pub fn iter( &self ) -> Chain<Chain<IntoIter<u64>, Cloned<Iter<'a, u64>>>, IntoIter<u64>>
pub fn count_ones(&self) -> usize
pub fn count_ones(&self) -> usize
Counts the number of ones
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for UnalignedBitChunk<'a>
impl<'a> Send for UnalignedBitChunk<'a>
impl<'a> Sync for UnalignedBitChunk<'a>
impl<'a> Unpin for UnalignedBitChunk<'a>
impl<'a> UnwindSafe for UnalignedBitChunk<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request