![Latest Version] ![docs] ![MIT] [![Rust](https://img.shields.io/badge/rust-1.53%2B-blue.svg?maxAge=3600)](https://github.com/ralfbiedert/interoptopus) Rust

Interoptopus

C#, Python, C, ... → 🐙 → 🦀

FFI from your favorite language to Rust. Escape hatchets included.

Overview

If you ...

... then Interoptopus might be for you.

Known Limitations

Example & Backends

Assume you have written this Rust FFI code:

```rust use interoptopus::{ffifunction, ffitype};

[ffi_type]

[repr(C)]

pub struct Vec3 { pub x: f32, pub y: f32, pub z: f32, }

[ffi_function]

[no_mangle]

pub extern "C" fn my_function(input: Vec3) -> Vec3 { Vec3 { x: 2.0, y: 4.0, z: input.z } }

interoptopus::inventoryfunction!(ffiinventory, [], [my_function], []); ```

You can now use one of these backends to generate interop code:

| Language | Crate | Sample Output | | --- | --- | --- | | C# (incl. Unity) | interoptopusbackendcsharp | Interop.cs | | C | interoptopusbackendc | myheader.h | | Python CFFI | interoptopusbackendcpythoncffi | reference.py | | Your language | Write your own backend! | - |

Features

See the reference project for a list of all supported features.

Current Status

FAQ

Contributing

PRs are welcome.