MCPcopy Create free account
hub / github.com/apache/arrow-rs / new

Method new

arrow-buffer/src/util/bit_iterator.rs:40–54  ·  view source on GitHub ↗

Create a new [`BitIterator`] from the provided `buffer`, and `offset` and `len` in bits # Panic Panics if `buffer` is too short for the provided offset and length

(buffer: &'a [u8], offset: usize, len: usize)

Source from the content-addressed store, hash-verified

38 ///
39 /// Panics if `buffer` is too short for the provided offset and length
40 pub fn new(buffer: &'a [u8], offset: usize, len: usize) -> Self {
41 let end_offset = offset.checked_add(len).unwrap();
42 let required_len = ceil(end_offset, 8);
43 assert!(
44 buffer.len() >= required_len,
45 "BitIterator buffer too small, expected {required_len} got {}",
46 buffer.len()
47 );
48
49 Self {
50 buffer,
51 current_offset: offset,
52 end_offset,
53 }
54 }
55}
56
57impl Iterator for BitIterator<'_> {

Callers

nothing calls this directly

Calls 5

lead_paddingMethod · 0.80
ceilFunction · 0.70
checked_addMethod · 0.45
iterMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected