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

Method from_unsliced_buffer

arrow-buffer/src/buffer/null.rs:245–249  ·  view source on GitHub ↗

Create a [`NullBuffer`] from an *unsliced* validity bitmap (`offset = 0` **bits**) of length `len`. Returns `None` if there are no nulls (all values valid).

(buffer: impl Into<Buffer>, len: usize)

Source from the content-addressed store, hash-verified

243 ///
244 /// Returns `None` if there are no nulls (all values valid).
245 pub fn from_unsliced_buffer(buffer: impl Into<Buffer>, len: usize) -> Option<Self> {
246 let bb = BooleanBuffer::new(buffer.into(), 0, len);
247 let nb = NullBuffer::new(bb);
248 (nb.null_count() > 0).then_some(nb)
249 }
250
251 /// Claim memory used by this null buffer in the provided memory pool.
252 #[cfg(feature = "pool")]

Callers

nothing calls this directly

Calls 1

null_countMethod · 0.45

Tested by

no test coverage detected