zvec-rust-sys
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:
- Environment variables:
ZVEC_LIB_DIRandZVEC_INCLUDE_DIR - Sibling directory:
../zvec/build/lib - Vendor directory:
vendor/lib - Auto-build (experimental): Clones and builds zvec from source
See the main README for detailed setup instructions.
Usage
Add this to your Cargo.toml:
[]
= { = "../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.