talu-sys 0.0.1-post.202602141835

Low-level FFI bindings for libtalu
docs.rs failed to build talu-sys-0.0.1-post.202602141835
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

talu-sys

Low-level FFI bindings to the talu C API.

This crate provides raw extern "C" function declarations and #[repr(C)] type definitions for linking against libtalu, the shared library that powers talu's inference engine.

Most users should depend on the talu crate instead, which provides safe, idiomatic Rust wrappers with RAII resource management and Result-based error handling.

How it works

At build time, talu-sys locates the native libtalu shared library:

  1. TALU_LIB_DIR env var — if set, links against the library in that directory (used for local development and custom builds).
  2. Automatic download — if TALU_LIB_DIR is not set, downloads the pre-built library from the matching GitHub Release based on the crate version and target platform.

Supported targets

Target Library
x86_64-unknown-linux-gnu libtalu.so
aarch64-apple-darwin libtalu.dylib

Downstream crates

talu-sys exposes DEP_TALU_LIB_DIR via Cargo's links mechanism, so downstream crates can locate the library for rpath embedding.

Example

use talu_sys::*;
use std::ffi::CString;
use std::os::raw::c_void;

let model_path = CString::new("/path/to/model").unwrap();
let mut handle: *mut c_void = std::ptr::null_mut();
unsafe {
    let rc = talu_backend_create(model_path.as_ptr(), &mut handle as *mut _ as *mut c_void);
    if rc != 0 {
        // handle error
    }
    // ... use handle ...
    talu_backend_free(handle);
}

License

MIT