BSON_VECTOR_INT8_CONST_VIEW_T(3)

πŸ“¦
version 2.5.6 Β· 3 versions
, in epel 10

πŸ’… bson_vector_int8_const_view_t πŸ’…

okay bestie, welcome to the <bson/bson.h> corner of libbson, where we're talking about a reference to non-owned const BSON Binary data holding a valid Vector of int8 element type. yes that's a mouthful, we'll get through it together 🫢


✨ SYNOPSIS ✨

#include <bson/bson.h>

typedef struct bson_vector_int8_const_view_t {
   /*< private >*/
} bson_vector_int8_const_view_t;

πŸ¦‹ DESCRIPTION πŸ¦‹

so bson_vector_int8_const_view_t is a struct that's basically a little peek-only window πŸ‘€ β€” it acts as an opaque const reference to a block of memory that has been validated as an int8 vector.

the way it's meant to be used? pass it by value, and you can literally discard it whenever, no strings attached πŸ’… the contents of the struct itself are private β€” like, don't touch, that's not for you, mind your business πŸ™ˆ.

⚠️ important, do NOT skip this: the bson_t MUST be valid for the lifetime of the view, and it is an error to modify the bson_t while you're using the view. no cap. modifying it mid-view is giving undefined chaos and we don't do that 🌸

πŸ”₯ EXAMPLE πŸ”₯

bson_iter_t iter;
bson_vector_int8_const_view_t view;

if (bson_iter_init_find (&iter, &doc, "vector") && bson_vector_int8_const_view_from_iter (&view, &iter)) {
  size_t length = bson_vector_int8_const_view_length (view);
  printf ("Elements in 'vector':\n");
  for (size_t i = 0; i < length; i++) {
    int8_t element;
    BSON_ASSERT (bson_vector_int8_const_view_read (view, &element, 1, i));
    printf (" [%d] = %d\n", (int) i, (int) element);
  }
}

SEE ALSO: bson_vector_int8_view_t β€” the non-const sibling, go say hi πŸ‘‹


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” icons, honestly ⭐


2009-present, MongoDB, Inc.


and that's the whole vibe check, bestie πŸ’– this was libbson manual page BSON_VECTOR_INT8_CONST_VIEW_T(3), version 2.5.6, dated Oct 09, 2026 β€” go forth and read your vectors safely, mwah πŸ§šβ€β™€οΈβœ¨πŸ“

πŸ“¦ where this page comes from