# BoltFFI

> BoltFFI generates native bindings and distributable packages for Rust libraries targeting Swift, Kotlin, Java, C#, TypeScript, and Python.

Use these Markdown pages as the source of truth for BoltFFI APIs and generated target-language behavior. Start with Getting Started for a new integration, then use the page that matches the Rust API being exported.

## Start here

- [BoltFFI Docs](https://boltffi.dev/docs/overview.md): Learn what BoltFFI does, how it generates native bindings from Rust, and how type mapping and memory management work across the FFI boundary.
- [Getting Started](https://boltffi.dev/docs/getting-started.md): Set up a BoltFFI Rust library, install prerequisites, configure packaging, and generate bindings for Apple, Android, Java, C#, WASM, and Python targets.
- [Installation](https://boltffi.dev/docs/installation.md): Install the BoltFFI CLI and crate dependencies, configure Cargo outputs, and prepare a Rust project for cross-language bindings.
- [Quick Start](https://boltffi.dev/docs/quick-start.md): Build your first BoltFFI project quickly with Rust setup, Cargo configuration, build scripts, and generated bindings for target platforms.
- [Tutorial](https://boltffi.dev/docs/tutorial.md): Build a complete counter library with BoltFFI from Rust code to Swift, Kotlin, and C# usage, including exports, records, classes, and packaging.

## Design a Rust API

- [Types](https://boltffi.dev/docs/types.md): Reference how Rust types map to Swift, Kotlin, Java, C#, TypeScript, and Python in BoltFFI, including supported primitives, collections, and performance notes.
- [Records](https://boltffi.dev/docs/records.md): Expose Rust structs and enums as BoltFFI records with #[data], including value semantics, nested types, and performance tradeoffs.
- [Classes](https://boltffi.dev/docs/classes.md): Expose Rust structs as BoltFFI classes with #[export] impl blocks, including constructors, methods, ownership, thread safety, and lifecycle management.
- [Functions](https://boltffi.dev/docs/functions.md): Export Rust free functions with #[export], map parameters and return values across languages, and understand naming and FFI behavior.
- [Constants](https://boltffi.dev/docs/constants.md): Export Rust constants as module-level values or associate them with records, enums, and classes across Swift, Kotlin, Java, C#, TypeScript, and Python.
- [Async](https://boltffi.dev/docs/async.md): Export async Rust functions and methods with BoltFFI and bridge futures to native async APIs in Swift, Kotlin, Java, C#, TypeScript, and Python.
- [Callbacks & Traits](https://boltffi.dev/docs/callbacks.md): Pass closures and trait callbacks between Rust and target languages in BoltFFI for events, progress reporting, and extensible integrations.
- [Streaming](https://boltffi.dev/docs/streaming.md): Expose Rust event streams with #[ffi_stream] and consume them as native async streams, flows, or callback-based APIs in generated bindings.
- [Errors](https://boltffi.dev/docs/errors.md): Map Rust Result<T, E> into native error handling in Swift, Kotlin, Java, C#, TypeScript, and Python with BoltFFI using string errors and structured error types.
- [Custom Types](https://boltffi.dev/docs/custom-types.md): Use custom_type! to map external Rust crate types like uuid or url into BoltFFI-friendly FFI representations with safe conversions.

## Build and package

- [Packaging](https://boltffi.dev/docs/packaging.md): Understand the BoltFFI packaging pipeline for compiling Rust artifacts, generating bindings and headers, and bundling outputs for each platform.
- [Configuration](https://boltffi.dev/docs/configuration.md): Configure boltffi.toml package names, target outputs, and platform packaging behavior for generated Swift, Kotlin, Java, C#, TypeScript, and Python bindings.

## Internals and experimental features

- [Experimental Features](https://boltffi.dev/docs/experimental.md): Enable and manage experimental BoltFFI features and targets such as TypeScript async streams.
- [Async Internals](https://boltffi.dev/docs/async-internals.md): Understand how BoltFFI bridges Rust futures across the FFI boundary, including polling, handles, and completion signaling in generated bindings.

## Complete documentation

- [All BoltFFI documentation in one file](https://boltffi.dev/llms-full.txt): The complete documentation corpus for tools that prefer a single context file.
