Rust bindings for zvec, packaged in two layers:
zvec: the low-level raw FFI crate generated frominclude/zvec/c_api.hzvec-rs/: a safe, JSON-first wrapper that is easier to use from Rust applications
This layout keeps the existing raw API stable while publishing the higher-level wrapper that Zephyr has been using internally as the basis for the upstream Rust experience.
Cargo.toml: workspace root and the rawzveccrate manifestbuild.rs: downloads prebuiltzvec_c_apiartifacts and generates bindgen outputinclude/zvec/c_api.h: vendored C API header used for bindgenexamples/basic.rs: raw FFI smoke-test examplezvec-rs/: safe wrapper crate with builder helpers, collection operations, and tests
Use zvec when you want direct access to the C API surface.
Use zvec-rs when you want:
- JSON-based schema and query builders
- safe document insert, update, delete, fetch, and query helpers
- typed
SearchResult,WriteResult, andCollectionStatsvalues
[dependencies]
zvec = { git = "https://github.com/ZephyrCloudIO/zvec-rs" }Run the bundled example:
cargo run -p zvec --example basic[dependencies]
zvec-rs = { git = "https://github.com/ZephyrCloudIO/zvec-rs", package = "zvec-rs" }
serde_json = "1"Run the safe example:
cargo run -p zvec-rs --example wrapper-basicSee zvec-rs/README.md for the higher-level API.
The main local checks for this repo are:
cargo test -p zvec-rs --all-features
cargo test --workspace
cargo run -p zvec --example basicAndroid CI keeps validating the raw crate build so release artifacts stay aligned with the upstream alibaba/zvec C API.
This repository is intended to be transferable: the raw crate remains the release anchor, while the safe wrapper is versioned in-tree and can evolve with the same upstream header and binary release process.
Additional repository context for maintainers lives in HANDOFF.md.