Building a Faster C# Driver for ScyllaDB…on our Self-Baked C#-Rust FFI Framework
Sep 22, 2026Cynthia Dunlop

Summary
This post details the practical application of ScyllaDB's custom asynchronous FFI framework for Rust and C# interop, specifically in modernizing the C# driver. It explains how raw P/Invoke and reverse P/Invoke calls are efficient, leveraging .NET 5+ features like `UnmanagedCallersOnly` and unmanaged function pointers. The post highlights the automation of the Rust library build and linking process within C# .csproj files to resolve development inefficiencies. It also introduces `BridgedPtr` as an FFI abstraction for Rust-owned data, adapted from `CassPtr`, and discusses the handling of C# objects passed as `IntPtr` to Rust.