🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| docs | ||
| examples | ||
| schemas | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| build.rs | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
IXT SDK for Rust
Official MIT-licensed SDK for developing IXT Framework modules
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:
- Reads schemas from
../ixt-public/schemas/ - Compiles
module.capnpandservices.capnp - Generates Rust code in
$OUT_DIR/ - 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
- Documentation: https://www.ixtaat.com
- Issues: https://git.h-dv.de/h-dv/ixt/issues
- Discussions: https://git.h-dv.de/h-dv/ixt/discussions