Rust SDK
Raw FFI bindings to the Cactus C API. Auto-generated viabindgen.
Installation
Add to yourCargo.toml:
- CMake
- C++20 compiler
- On macOS: Xcode command line tools
- On Linux:
build-essential,libcurl4-openssl-dev,libclang-dev
Usage
All functions mirror the C API. The Rust bindings provide direct FFI access to all Cactus Engine functionality.Basic Example
Transcription Example
Embeddings Example
Vector Index Example
API Reference
All functions mirror the C API documented in the C API Reference. Key functions include:Init / Lifecycle
Completion
Transcription
Embeddings
Vector Index
Testing
Safety Considerations
All functions are marked asunsafe because they interact with C FFI. When using this crate:
- Always check returned pointers for null before dereferencing
- Ensure strings are valid UTF-8 and null-terminated
- Handle memory management carefully (initialize and destroy models)
- Use proper error checking with
cactus_get_last_error()
See Also
C API Reference
Full C API reference that the Rust bindings wrap
Python SDK
Python bindings with higher-level wrappers
Swift SDK
Swift bindings for Apple platforms
Kotlin SDK
Kotlin bindings for Android