18 unstable releases (3 breaking)

Uses new Rust 2024

0.4.1 Jan 17, 2026
0.4.0 Jan 17, 2026
0.3.3 Jan 15, 2026
0.3.2 Dec 30, 2025
0.1.11 Dec 18, 2025

#126 in #python-bindings

MIT/Apache

115KB
2K SLoC

fast-yaml-ffi

Crates.io docs.rs CI MSRV License

FFI utilities for fast-yaml language bindings.

Installation

Add to your Cargo.toml:

[dependencies]
fast-yaml-ffi = "0.3"

Or with cargo-add:

cargo add fast-yaml-ffi

[!IMPORTANT] Requires Rust 1.88 or later.

Overview

This crate provides generic traits and utilities for converting between Rust types and foreign types (Python via PyO3, Node.js via NAPI-RS).

Core Traits

  • ToFfi<T> — Convert Rust types to foreign types
  • FromFfi<T> — Convert foreign types to Rust types

Usage

use fast_yaml_ffi::{ToFfi, FromFfi};

// Convert Rust value to Python object
let py_obj = rust_value.to_ffi()?;

// Convert Python object to Rust value
let rust_value = RustType::from_ffi(&py_obj)?;

[!NOTE] This crate is primarily used internally by fast-yaml (Python) and fast-yaml-nodejs bindings.

This crate is part of the fast-yaml workspace:

  • fast-yaml-core — Core YAML 1.2.2 parser and emitter
  • fast-yaml-linter — YAML linting with rich diagnostics
  • fast-yaml-parallel — Multi-threaded YAML processing

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.

Dependencies

~1.7–2.4MB
~43K SLoC