Rust Core Architecture

Generate a Rust core library with FFI bindings for Python, Node.js, Ruby, PHP, and WebAssembly.

115|8|Updated Mar 30, 2025
One-click install
npx skills add https://github.com/Goldziher/spikard --skill rust-core-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Rust Core Architecture
Source: https://github.com/Goldziher/spikard/tree/main/.ai-rulez/skills/rust-core-arch
Command: npx skills add https://github.com/Goldziher/spikard --skill rust-core-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a foundational architecture for building high-performance, type-safe web services using Rust, with seamless integration into multiple programming languages.

Core Features & Use Cases

  • Core Library: Implements domain logic with clear separation of concerns and robust error handling using thiserror.
  • Processing Pipeline: Defines a standard flow for parsing, transforming, validating, and formatting data.
  • Multi-Language Bindings: Offers FFI (Foreign Function Interface) for Python (PyO3), Node.js (NAPI-RS), Ruby (Magnus), PHP (ext-php-rs), and WebAssembly (WASM).
  • Testing Strategy: Emphasizes comprehensive testing including doc tests, unit tests, integration tests, and benchmarks.

Quick Start

Leverage the Rust Core Architecture skill to generate a new Rust library with PyO3 bindings for Python integration.

Frequently Asked Questions about Rust Core Architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Rust core library with FFI bindings for Python and Node.js?

To build a Rust core library with FFI bindings, use this architecture to implement domain logic and generate bindings via PyO3 for Python and NAPI-RS for Node.js, ensuring type-safe cross-language integration.

What is the best way to structure a multi-language Rust web service?

Structuring a multi-language Rust web service requires separating domain logic from bindings, using thiserror for error handling, and defining a standard processing pipeline for parsing, validating, and transforming data across FFI boundaries.

Can I use Rust to share processing logic across PHP, Ruby, and WebAssembly?

Yes, you can share Rust processing logic across PHP, Ruby, and WebAssembly by generating FFI bindings using ext-php-rs, Magnus, and WASM targets, allowing high-performance domain logic execution in each environment.

How does the processing pipeline handle data validation and transformation in Rust?

The processing pipeline handles data validation and transformation by defining a standard flow: parsing raw input, applying transformations, validating domain rules, and formatting output before returning results across the FFI boundary.

Do I need to write separate tests for Rust core logic and FFI bindings?

You need a comprehensive testing strategy covering doc tests, unit tests for core logic, integration tests for FFI bindings, and benchmarks to verify performance and reliability across Rust and target language boundaries.

Why use a Rust core architecture instead of writing services natively in Python or Node.js?

Using a Rust core architecture provides high-performance, type-safe domain logic that prevents runtime errors common in dynamically typed languages, while FFI bindings allow seamless integration without rewriting logic for each platform.