BSON_VECTOR_PA..._VIEW_PACK_BOOL(3)
π BSON_VECTOR_PA..._VIEW_PACK_BOOL
okay so this is a libbson page, bestie β it's bson_vector_packed_bit_view_pack_bool(3), the girlies on the manual squad just had to squish the name down to BSON_VECTOR_PA..._VIEW_PACK_BOOL(3) so it'd fit in the header π. Its whole job? Packing a contiguous block of elements from a C bool array into a bson_vector_packed_bit_view_t. That's it. That's the gig. slay.
β¨ SYNOPSIS β¨
bool
bson_vector_packed_bit_view_pack_bool (bson_vector_packed_bit_view_t view,
const bool *unpacked_values,
size_t element_count,
size_t vector_offset_elements)
π PARAMETERS π
viewβ a validbson_vector_packed_bit_view_t. like, it has to be valid bestie, no cap π«Άunpacked_valuesβ where theboolelements get packed from, the source of truth πelement_countβ how many elements we're packing, the headcount π’vector_offset_elementsβ the vector index of the first element to pack, i.e. where in the vector we start π―
π¦ DESCRIPTION π¦
Elements get packed into individual Vector bits, and they come straight out of a C bool array. one bool per bit, cute little glow-up into packed-bit form β¨
π₯ RETURNS π₯
So if element_count and vector_offset_elements overflow the bounds of the Vector, it returns false and does literally nothing else β no other action taken, not a single bit touched π.
But if the parameters are in range? bestie, it's guaranteed to succeed. iconic. On success it returns true and writes element_count elements in the Vector, starting at vector_offset_elements. periodt. π
π AUTHOR π
MongoDB, Inc β yes, that MongoDB π
π COPYRIGHT π
2009-present, MongoDB, Inc. β all the rights, reserved and glowing β¨
ngl the only way this fails is the bounds check, so vibe check your offsets before you call it fr fr π
okay that's the whole page, hope it ate π β this was version 2.5.6, dated Oct 09, 20β¦ (the last digits got cut off in the header, not me, blame the column width π), and that's your sign-off bestie, mwah π
π
π¦ where this page comes from
- epel 10: libbson-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms