narrow/arrow/buffer/
null_buffer.rs

1//! Interop with [`arrow-rs`] null buffer.
2
3use crate::Length;
4
5impl Length for arrow_buffer::NullBuffer {
6    fn len(&self) -> usize {
7        arrow_buffer::NullBuffer::len(self)
8    }
9}
10
11#[cfg(test)]
12mod tests {
13    use super::*;
14
15    const INPUT: [bool; 4] = [true, true, false, true];
16
17    #[test]
18    fn length() {
19        let null_buffer = INPUT.into_iter().collect::<arrow_buffer::NullBuffer>();
20        assert_eq!(Length::len(&null_buffer), INPUT.len());
21    }
22}