Boolean¶
The B8 type is a one-byte boolean. Atoms are built with Value::bool, vectors
with Value::bool_vec.
Atoms¶
Vectors¶
Reading the buffer¶
Booleans are stored one per byte. bool_slice() returns the raw &[u8]
backing store, where 1 is true and 0 is false — zero-copy, no allocation.
To get a Value per element instead, use get:
let b = Value::bool_vec(&[true, false]);
assert!(b.get(0)?.as_bool()?);
assert!(!b.get(1)?.as_bool()?);
bool_slice is for B8 vectors only
bool_slice() returns &[u8] because that is the on-wire layout; it is not
the same as as_slice::<u8>() on a U8 vector. Use it when you want to scan
or memcpy a boolean column without boxing each element.
See Vectors for indexing, slicing, and mutation that apply to every vector type.