Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/LiveSplit/livesplit-core/llms.txt

Use this file to discover all available pages before exploring further.

livesplit-core is written in Rust, but ships a C-compatible API (livesplit-core-capi) that serves as a universal bridge to every other supported language. All language bindings are auto-generated by the capi/bind_gen tool: it parses the Rust C API source with syn, derives the full type and function graph, and writes idiomatic wrapper classes into capi/bindings/.

Available bindings

LanguageMechanismUse Case
RustDirect (native)Any Rust project
C / C++Header fileNative applications
C#P/Invoke.NET / Unity
JavaJNA or JNIAndroid, desktop Java
KotlinJNIAndroid, Kotlin desktop
SwiftC interopiOS, macOS
JavaScriptNode.js FFIServer-side JS
TypeScriptNode.js FFIServer-side TS
WebAssemblywasm-bindgenWeb browsers
RubyFFI gemRuby scripts
PythonctypesPython scripts

How bindings are structured

Every binding follows the same shape:
  • Three tiers per typeTimerRef (shared borrow), TimerRefMut (mutable borrow), and Timer (owned). The owned class is the only one responsible for freeing memory.
  • Owned objects must be explicitly freed. Each owned class exposes a drop / Dispose / [Symbol.dispose] method (language-specific). Forgetting to call it leaks native memory.
  • Static constructors map to language-level constructors or factory methods (e.g. Run_newnew Run() in Java, new Run() in C#, Run_new() in C).

How to obtain bindings

Option 1 — Pre-built releases

Download the native library and the binding source files from the GitHub Releases page. Every release includes a .zip per target platform containing the shared/static library and all language-specific binding files.

Option 2 — Generate from source

Clone the repository, then run the binding generator:
# 1. Build the native library
cargo build --release -p livesplit-core-capi

# 2. Generate all language bindings
cd capi/bind_gen
cargo run
Bindings are written to capi/bindings/:
capi/bindings/
├── livesplit_core.h        # C / C++
├── LiveSplitCore.cs        # C#
├── java/                   # Java (JNA + JNI subdirectories)
├── kotlin/                 # Kotlin (JNI)
├── swift/                  # Swift (LiveSplitCore + CLiveSplitCore)
├── node/                   # JavaScript + TypeScript for Node.js
├── wasm_bindgen/           # WebAssembly (bundler + web subdirectories)
├── LiveSplitCore.rb        # Ruby
└── livesplit_core.py       # Python

Binding pages

C / C++

Opaque pointer API via a C header. Works directly in C++ with the LiveSplit namespace.

C#

P/Invoke wrappers. Each type implements IDisposable for safe cleanup in .NET and Unity.

Java / Kotlin

JNA for desktop Java and JNI for Android. Kotlin bindings use JNI exclusively.

Swift

C interop via a module map. Integrates with Xcode and Swift Package Manager.

JavaScript / WebAssembly

Node.js FFI binding and a wasm-bindgen WebAssembly module for browsers.

Ruby / Python

Ruby FFI gem and Python ctypes wrappers around the native C library.

Build docs developers (and LLMs) love