zvec-rust-sys 0.7.0

Raw FFI bindings to the zvec C-API
Documentation
  • Coverage
  • 22.13%
    112 out of 506 items documented0 out of 32 items with examples
  • Size
  • Source code size: 92.41 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.68 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • zvec-ai/zvec-rust
    25 6 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • chinaux

zvec-rust-sys

License

Raw FFI bindings to the zvec C-API (libzvec_c_api).

Overview

This crate provides low-level, unsafe Rust bindings to the zvec vector database C library. It is intended to be used by the higher-level zvec-rust crate, which provides safe, idiomatic Rust APIs.

You probably want to use the zvec-rust crate instead.

Contents

  • Opaque pointer types for all zvec C objects (collections, documents, schemas, queries, etc.)
  • extern "C" function declarations matching the zvec C-API
  • Constants for error codes, data types, index types, metric types, and more

Prerequisites

This crate requires the zvec C library (libzvec_c_api) to be available at link time. The build script (build.rs) resolves the library location in the following order:

  1. Environment variables: ZVEC_LIB_DIR and ZVEC_INCLUDE_DIR
  2. Sibling directory: ../zvec/build/lib
  3. Vendor directory: vendor/lib
  4. Auto-build (experimental): Clones and builds zvec from source

See the main README for detailed setup instructions.

Usage

Add this to your Cargo.toml:

[dependencies]
zvec-rust-sys = { path = "../zvec-sys" }

All functions are unsafe and require careful handling of raw pointers and C memory management. Prefer the safe zvec-rust crate for application code.

License

Apache-2.0 — see LICENSE.