rustduck-sys 1.0.0

Raw Rust FFI bindings to the C ABI used by TSDuck's Python API
Documentation

rustduck-sys

The low-level TSDuck boundary. It binds the native tspy* C ABI that TSDuck provides for its Python API and reuses that stable C-facing surface from Rust; it neither embeds nor depends on a Python runtime. This is the only crate that declares raw tspy* functions and CXX bridge signatures.

  • src/raw.rs — exact raw declarations for TSDuck's official tspy* C ABI.
  • src/bridge.rs — the single CXX bridge declaration module.
  • native/bridge/ — version-matched C++ adapters compiled against the installed TSDuck headers.
  • native/tspy.h — a repository-owned mirror of TSDuck's Python ABI. The ABI probe verifies the Rust declarations against this mirror, not against TSDuck's internal C++ classes.

TSDuck requirements

  • TSDuck 3.44.x development headers and runtime library.
  • When TSDuck is not under a standard prefix, set TSDUCK_PREFIX, TSDUCK_INCLUDE_DIR, or TSDUCK_LIBRARY_DIR.
  • The build rejects other TSDuck versions, emits the version constants used by raw, and writes a per-profile compile_commands.json.

Native source manifest

build.rs holds the single NATIVE_SOURCES / NATIVE_HEADERS manifest. Adding a native .cpp or .h file requires updating the manifest; the build validates that the directory contents and the manifest agree.

Development

This crate owns raw ABI declarations, CXX bridge signatures, and native pointer operations. rustduck-core keeps any required unsafe implementation in a narrow, locally justified safety boundary.

cargo test -p rustduck-sys
cargo test -p rustduck-sys --features native_test_hooks

The native_test_hooks feature compiles the C++ fault-injection seams used by tests/native_failure.rs. Release consumers leave it disabled, so the bridge exposes no test surface and ships no live test seam.

Rules

Native boundaries · Dependencies and release policy

Third-party notices

This crate compiles against TSDuck 3.44.x headers and links the installed TSDuck shared library. See THIRD-PARTY.md; TSDuck is BSD 2-Clause.