C++ Templates · Serialization

Serialization

8122c932

Ask your coding agent about this page, or add the docs server to it

curl -s 'https://www.unum.cloud/docs/usearch/templates/serialization.md' | claude -p "How would this fit my code?"

§ Saving & Loading

Payloads are arbitrary objects, so save and load take a codec that encodes each value into its own slice and back:

  • storage_requirements(value) sizes one value’s slice.
  • save(value, output) encodes it.
  • load(input, value) decodes it into a pre-constructed record.

save fills five caller-placed columns sized from columns_extents, while searches keep running, and load reads them back into an empty index, publishing everything at once.