Expand description
§kglite-c — C ABI for the kglite knowledge graph engine.
Non-Rust bindings (Go via cgo, JavaScript via napi, JVM via JNI,
.NET via P/Invoke, …) consume a single C header
(include/kglite.h) rather than re-implementing wrappers in
their host language. This crate is glue — the engine itself
lives in kglite, and kglite-c exposes a curated subset via
#[no_mangle] extern "C" functions.
See docs/rust/c-abi.md in the kglite repo for the design
conventions (naming, ownership, error pattern, JSON-at-boundary
choices) and crates/kglite-c/README.md for the user-facing
quickstart.
§Module structure
abi— ABI version probe + status code helpers.status—KgliteStatusCodeenum +KgErrorCodemapping.strings— owned-out-string allocation +kglite_free_string.graph—KgliteGraphopaque handle + load/save/free.session—KgliteSessionopaque handle + execute_read / execute_mut.result—KgliteCypherResultopaque handle + JSON accessors.
Each submodule’s items are re-exported at the crate root so the
generated kglite.h is a flat namespace.
Re-exports§
pub use abi::*;pub use embedder::*;pub use graph::*;pub use result::*;pub use session::*;pub use status::*;pub use strings::*;
Modules§
- abi
- ABI version probe — bindings call
kglite_abi_versionon startup and fail loudly if the runtime ABI’s major version doesn’t match what they were compiled against. - datasets
- Dataset C ABI — synchronous wrappers over kglite’s blocking fetchers. One submodule per dataset; each gated behind its matching Cargo feature so consumers can opt into only the loaders they need.
- embedder
KgliteEmbedderopaque handle + concrete-impl factories.- graph
KgliteGraphopaque handle — load_file, save_graph, free.- result
KgliteCypherResultopaque handle + JSON accessors.- session
KgliteSessionopaque handle — session creation + execute_read / execute_mut.- status
- Status-code surface:
KgliteStatusCodeenum + 1:1 mapping tokglite::api::KgErrorCode+ the three canonical accessors (name,neo4j_status,http_status). - strings
- Owned-out-string allocation. Every C-ABI function that hands a
string back to the caller goes through [
alloc_c_string] (which returns a*const c_charthe caller MUST free viakglite_free_string).