pub fn f32_to_bytes(v: &[f32]) -> &[u8] ⓘExpand description
Convert &[f32] to &[u8] for sqlite-vec storage.
§Safety
This function is sound when the following invariants hold:
f32has no padding bytes per the Rust reference (https://doc.rust-lang.org/reference/types/numeric.html);[f32]has the same byte representation as[u8; size_of_val(v)].- The returned
&[u8]borrows fromv; its lifetime is tied to the input slice. - Endianness matches sqlite-vec on supported platforms (x86_64, aarch64 little-endian).
Targets with big-endian
f32storage are not supported by sqlite-vec.