BSON_ITER_OVERWRITE_BINARY(3)

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

πŸ’… BSON_ITER_OVERWRITE_BINARY(3) β€” libbson, but make it group chat πŸ’…

okay so bestie, this is the BSON_ITER_OVERWRITE_BINARY(3) page from libbson, and it's giving β€œI have direct, in-place access to a binary field” energy. No cap. πŸ’–

✨ SYNOPSIS ✨

void
bson_iter_overwrite_binary (bson_iter_t *iter,
                            bson_subtype_t subtype,
                            uint32_t *binary_len,
                            uint8_t **binary);

πŸŽ€ PARAMETERS πŸŽ€

  • iter β€” a bson_iter_t. The iterator bestie in question. 🫢
  • subtype β€” the expected bson_subtype_t.
  • binary_len β€” a location for the length of binary.
  • binary β€” a location for a pointer to the mutable buffer.

πŸ¦‹ DESCRIPTION πŸ¦‹

The bson_iter_overwrite_binary() function obtains mutable access to a BSON_TYPE_BINARY element in place. In-place access, literally. ✨

This may only be done when the underlying bson document allows mutation. So yeah β€” mutation permission is the vibe check here. πŸ’…

It is a programming error to call this function when iter is not observing an element of type BSON_TYPE_BINARY and the provided subtype. Like, actual programming error, not a cute little oopsie. πŸ’€

The buffer that binary points to is only valid until the iterator's bson_t is otherwise modified or freed. So that pointer has a shelf life, bestie β€” that's the whole window. πŸ•°οΈ

πŸ‘€ SEE ALSO: πŸ‘€

  • bson_iter_binary()

🌈 AUTHOR 🌈

MongoDB, Inc

2009-present, MongoDB, Inc.

bye bestie β€” this page is from libbson 2.5.6, dated Oct 09, 2026 πŸ’–βœ¨

πŸ“¦ where this page comes from