Skip to main content

build_views_from_offsets

Function build_views_from_offsets 

Source
pub fn build_views_from_offsets<P: NativePType + AsPrimitive<usize>>(
    start_buf_index: u32,
    max_buffer_len: usize,
    bytes: ByteBuffer,
    offsets: &[P],
) -> (Vec<ByteBuffer>, Buffer<BinaryView>)
Expand description

build_views for values described by an offsets buffer instead of lengths.

offsets are absolute positions into bytes — the layout a VarBinArray stores — so there is one more offset than there are values, and the values need not start at the beginning of bytes: only offsets[0]..offsets[last] is referenced, and the returned buffers are zero-copy slices of that range.

§Panics

Panics if offsets is empty, not monotonically non-decreasing within bytes, or if a single value exceeds max_buffer_len.