plcbundle-rs
A high-performance plcbundle management tool and library written in Rust.
Overview
plcbundle-rs provides a universal and efficient interface for managing PLC bundle repositories. It offers:
- Rust Library: Core functionality with a clean, high-level API
- CLI Tool: Comprehensive command-line interface for bundle operations
- HTTP Server: Built-in server with WebSocket support
- FFI Bindings: C and Go bindings for cross-language integration
Features
- ✅ Bundle Management: Load, inspect, and manipulate PLC bundles
- ✅ DID Resolution: Resolve DIDs and query operations
- ✅ Synchronization: Sync with remote PLC servers
- ✅ Verification: Verify bundle integrity and operation chains
- ✅ Query & Export: Flexible querying and export capabilities
- ✅ Index Management: Efficient DID indexing and lookup
- ✅ Performance: Memory-mapped files, parallel processing, and optimized data structures
Installation
From Source
# Clone the repository
# Build with default features (CLI, Server)
# Install the binary
# or simply run
As a Library
Add to your Cargo.toml:
[]
= "0.9"
Quick Start
CLI Usage
# Initialize a new repository
# Sync with remote server
# Query operations for a DID
# Export bundles
# Start HTTP server
# View repository status
Library Usage
use ;
// Initialize manager
let manager = new?;
// Resolve a DID
let doc = manager.resolve_did?;
// Query operations
let ops = manager.get_did_operations?;
// Load a bundle
let result = manager.load_bundle?;
Project Structure
plcbundle-rs/
├── src/
│ ├── lib.rs # Library entry point
│ ├── manager.rs # Core BundleManager API
│ ├── cli/ # CLI commands
│ ├── server/ # HTTP server implementation
│ └── ... # Core modules
├── bindings/
│ └── go/ # Go FFI bindings
├── docs/ # Documentation
│ ├── API.md # API reference
│ ├── BUNDLE_FORMAT.md # Bundle format specification
│ └── ...
└── tests/ # Integration tests
Documentation
- API Documentation - Complete API reference
- Bundle Format - Bundle file format specification
- Logging - Logging configuration
- Specification - PLC specification
Development
Building
# Build with all features
# Run tests
# Generate documentation
Features
cli(default): Enables CLI functionalityserver: Enables HTTP server and WebSocket support
Running Tests
# Run all tests
# Run specific test suite
🚨 Important for Contributors and AI Assistants
Please read RULES.md before contributing or generating code.
Key principle: CLI commands and server code NEVER open bundle files directly - all operations go through the BundleManager API.
License
Dual-licensed under MIT OR Apache-2.0
Author
Tree tree@tree.fail