arrow_buffer::bit_chunk_iterator

Struct UnalignedBitChunk

Source
pub struct UnalignedBitChunk<'a> {
    lead_padding: usize,
    trailing_padding: usize,
    prefix: Option<u64>,
    chunks: &'a [u64],
    suffix: Option<u64>,
}
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

Fields§

§lead_padding: usize§trailing_padding: usize§prefix: Option<u64>§chunks: &'a [u64]§suffix: Option<u64>

Implementations§

Source§

impl<'a> UnalignedBitChunk<'a>

Source

pub fn new(buffer: &'a [u8], offset: usize, len: usize) -> Self

Create a from a byte array, and and an offset and length in bits

Source

pub fn lead_padding(&self) -> usize

Returns the number of leading padding bits

Source

pub fn trailing_padding(&self) -> usize

Returns the number of trailing padding bits

Source

pub fn prefix(&self) -> Option<u64>

Returns the prefix, if any

Source

pub fn suffix(&self) -> Option<u64>

Returns the suffix, if any

Source

pub fn chunks(&self) -> &'a [u64]

Returns reference to the chunks

Source

pub fn iter(&self) -> UnalignedBitChunkIterator<'a>

Returns an iterator over the chunks

Source

pub fn count_ones(&self) -> usize

Counts the number of ones

Trait Implementations§

Source§

impl<'a> Debug for UnalignedBitChunk<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for UnalignedBitChunk<'a>

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,