Skip to main content

Module fixed_size_binary

Module fixed_size_binary 

Source
Expand description

FixedSizeBinaryArray — a column of equally sized byte blobs.

No offset buffer: slot i is exactly values[i * size .. (i + 1) * size]. This is the layout AstRS uses for hashes, fixed-length IDs, small fixed-shape sensor records and the raw bytes of a fixed-format image tile, and it is the cheapest variable-free byte layout Arrow offers.

use astrs_data::array::{Array, FixedSizeBinaryArray};

let hashes = FixedSizeBinaryArray::try_from_values(4, [&b"aaaa"[..], &b"bbbb"[..]])?;
assert_eq!(hashes.len(), 2);
assert_eq!(hashes.value_size(), 4);
assert_eq!(hashes.get(1), Some(&b"bbbb"[..]));

Structs§

FixedSizeBinaryArray
A column of size-byte blobs with an optional validity bitmap.