Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mofa-ffi

Foreign Function Interface bindings for multiple languages.

Purpose

mofa-ffi provides:

  • UniFFI bindings for Python, Java, Go, Swift, Kotlin
  • PyO3 native Python bindings
  • Cross-language type conversions

Supported Languages

LanguageMethodStatus
PythonUniFFI / PyO3Stable
JavaUniFFIBeta
GoUniFFIBeta
SwiftUniFFIBeta
KotlinUniFFIBeta

Usage

Build Bindings

# Build all bindings
cargo build -p mofa-ffi --features uniffi

# Build Python only
cargo build -p mofa-ffi --features python

Generate Bindings

# Python
cargo run -p mofa-ffi --features uniffi -- generate python

# Java
cargo run -p mofa-ffi --features uniffi -- generate java

Feature Flags

FlagDescription
uniffiEnable UniFFI bindings
pythonEnable PyO3 Python bindings

See Also