shape-abi-v1 0.1.2

Stable host ABI v1 for Shape capability modules
Documentation

Shape ABI v1

Stable C ABI for host-loadable Shape capability modules. Current capability families include data sources and output sinks.

Design Principles

  • Stable C ABI: Uses #[repr(C)] for binary compatibility across Rust versions
  • Self-Describing: Plugins declare their query parameters and output fields
  • MessagePack Serialization: Data exchange uses compact binary format
  • Binary Columnar Format: High-performance direct loading (ABI v2)
  • Platform-Agnostic: Works on native targets

Creating a Data Capability Module

use shape_abi_v1::*;

// Define your plugin info
#[no_mangle]
pub extern "C" fn shape_plugin_info() -> *const PluginInfo {
    static INFO: PluginInfo = PluginInfo {
        name: c"my-data-source".as_ptr(),
        version: c"1.0.0".as_ptr(),
        plugin_type: PluginType::DataSource,
        description: c"My custom data source".as_ptr(),
    };
    &INFO
}

// Optional but recommended: capability manifest
#[no_mangle]
pub extern "C" fn shape_capability_manifest() -> *const CapabilityManifest { ... }

// Implement the vtable functions...