No description
Find a file
Dirk Hoyer acab5101fa style: Apply rustfmt formatting
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 22:10:28 +01:00
docs feat(sdk): Add authentication documentation and examples v0.2.2 2025-11-29 16:37:40 +01:00
examples style: Apply rustfmt formatting 2025-12-06 22:10:28 +01:00
schemas feat(sdk): Implement complete Rust SDK with FFI bridge and Cap'n Proto integration 2025-10-23 08:38:36 +02:00
scripts feat(sdk): Implement complete Rust SDK with FFI bridge and Cap'n Proto integration 2025-10-23 08:38:36 +02:00
src feat(i103): Module interface simplification v0.2.1 2025-11-27 13:53:19 +01:00
tests style: Apply rustfmt formatting 2025-12-06 22:10:28 +01:00
.gitignore feat(sdk): Implement complete Rust SDK with FFI bridge and Cap'n Proto integration 2025-10-23 08:38:36 +02:00
build.rs feat(sdk): Implement complete Rust SDK with FFI bridge and Cap'n Proto integration 2025-10-23 08:38:36 +02:00
Cargo.toml chore: Sync with workspace version 2025-12-04 18:24:50 +01:00
LICENSE feat(sdk): Implement complete Rust SDK with FFI bridge and Cap'n Proto integration 2025-10-23 08:38:36 +02:00
README.md fix: Update URLs to use correct ixtaat.com domains 2025-11-02 16:08:39 +01:00

IXT SDK for Rust

Official MIT-licensed SDK for developing IXT Framework modules

License: MIT Rust Version

Overview

The IXT SDK provides type-safe, zero-copy module development for the IXT Framework. All types are automatically generated from Cap'n Proto schemas to ensure:

  • Type Safety: Compile-time verification of module interfaces
  • Zero-Copy Performance: Cap'n Proto serialization with no overhead
  • Multi-Language Support: Same schemas used for Rust, Go, TypeScript, Python
  • MIT Licensed: No proprietary dependencies - safe for commercial use

Installation

Add to your Cargo.toml:

[dependencies]
ixt-sdk = "0.1"

Quick Start

use ixt_sdk::prelude::*;

pub struct MyModule {
    config: String,
}

// Implement your module logic using generated types from schemas
impl MyModule {
    pub fn new() -> Self {
        Self {
            config: String::new(),
        }
    }
}

See examples/hello_module.rs for a complete working example.

Generated Types

The SDK automatically generates Rust code from Cap'n Proto schemas during build:

Core Module Interface (module_capnp)

Generated from ixt-public/schemas/module.capnp:

  • Message: Inter-module message structure
  • Response: Message response types
  • IxtError: Standard error types
  • ModuleConfig: Module configuration
  • HealthStatus: Health monitoring
  • ModuleMetadata: Module metadata
  • IxtModule: Main module interface trait
  • RequestContext: Per-request context with tracing
  • SecurityContext: Authentication and authorization

Service Interfaces (services_capnp)

Generated from ixt-public/schemas/services.capnp:

  • KvStore: Key-value storage interface
  • MessageBus: Inter-module messaging
  • Config: Configuration access
  • Logger: Structured logging
  • AssetResolver: Static asset access
  • ModuleServices: Service container

Build Process

The SDK uses a build.rs script that automatically compiles Cap'n Proto schemas during compilation:

  1. Reads schemas from ../ixt-public/schemas/
  2. Compiles module.capnp and services.capnp
  3. Generates Rust code in $OUT_DIR/
  4. Re-exports types via ixt_sdk::prelude::*

No manual code generation required - it happens automatically on cargo build.

Features

Type-Safe Message Handling

All message types are generated from schemas, providing compile-time safety:

use ixt_sdk::module_capnp::Message;

// Message structure is auto-generated and type-safe
let msg: Message = ...;

Zero-Copy Serialization

Cap'n Proto provides efficient, zero-copy serialization:

  • No parsing overhead
  • Minimal memory allocations
  • Faster than JSON/MessagePack
  • Language-agnostic compatibility

License Compliance

Critical: This SDK has ZERO proprietary dependencies:

$ cargo tree | grep ixt-core
# (returns empty - no ixt-core dependency)

$ cargo license --tsv | awk -F'\t' 'NR>1 {print $6}' | sort | uniq
Apache-2.0 OR MIT
MIT
MIT OR Unlicense

All dependencies are MIT or Apache-2.0 licensed, making this SDK safe for:

  • Commercial projects
  • Open source projects
  • Proprietary modules
  • crates.io publication

Development

Build

cargo build

Test

cargo test

Run Example

cargo run --example hello_module

Generate Documentation

cargo doc --no-deps --open

Schema Evolution

The SDK follows Cap'n Proto's schema evolution rules:

  • Never change schema IDs
  • Always add new fields with higher ordinals
  • Never remove or reorder existing fields
  • Use unions for variant types

See ixt-public for schema versioning details.

Architecture

┌──────────────────────────────────────────────┐
│ ixt-public (MIT, Git Submodule)              │
│ ├── schemas/module.capnp                     │
│ └── schemas/services.capnp                   │
└────────────────┬─────────────────────────────┘
                 │
                 │ capnpc generates during build
                 ↓
┌──────────────────────────────────────────────┐
│ ixt-sdk (MIT)                                │
│ ├── Generated Rust types                     │
│ ├── Zero proprietary dependencies            │
│ └── Ready for crates.io publication          │
└──────────────────────────────────────────────┘
                 ↑
                 │ Module developers depend on
                 │
┌──────────────────────────────────────────────┐
│ Your Module (Any License)                    │
│ ├── use ixt_sdk::prelude::*;                 │
│ ├── 100% MIT-licensed dependencies           │
│ └── No licensing issues                      │
└──────────────────────────────────────────────┘

Dependencies

  • capnp (MIT): Cap'n Proto runtime
  • capnpc (MIT): Cap'n Proto compiler (build-time only)
  • tokio (MIT): Async runtime
  • serde (MIT/Apache-2.0): Serialization
  • async-trait (MIT/Apache-2.0): Async trait support
  • thiserror (MIT/Apache-2.0): Error handling

Total: 52 dependencies, all MIT or Apache-2.0 licensed.

Version Compatibility

SDK Version Runtime Version Schema Version
0.1.x 1.0.x 1.0.0

Contributing

See the main IXT repository for contribution guidelines.

License

MIT License - see LICENSE file for details.

This SDK is fully open source and can be used in any project without restrictions.

No proprietary dependencies. Safe for commercial use.

Support