A complete, production-ready implementation of the Cap'n Web protocol in Rust, providing capability-based RPC with promise pipelining and multi-transport support.
✅ Full Protocol Compliance - Implements the complete Cap'n Web wire protocol 🔒 Capability-Based Security - Unforgeable capability references with automatic lifecycle management 🚀 Promise Pipelining - Reduced round-trips through dependency resolution 🌐 Multi-Transport - HTTP batch, WebSocket, and WebTransport support 🛡️ Production-Ready - Zero-panic code, comprehensive error handling with context ✅ IL Expression Evaluation - Complete intermediate language support with array notation 🌍 JavaScript Interop - Validated against official TypeScript implementation
The implementation is organized into focused crates:
- capnweb-core - Core protocol implementation (messages, IL, validation)
- capnweb-transport - Transport layer implementations (HTTP, WebSocket, WebTransport)
- capnweb-server - Server implementation with capability management
- capnweb-client - Client implementation with ergonomic recorder API
- capnweb-interop-tests - JavaScript interoperability verification
Run the included examples to see the implementation in action:
Run benchmarks to measure performance:
The implementation includes optimizations for:
- Concurrent capability execution
- Efficient promise dependency resolution
- Connection pooling and reuse
- Minimal memory allocations
Comprehensive test suite with tests across all core modules:
The Rust implementation is fully compatible with JavaScript Cap'n Web implementations:
- ✅ Identical message formats and serialization
- ✅ Compatible IL plan structures
- ✅ Matching error handling patterns
- ✅ Shared protocol semantics
Test interoperability:
- Use proper TLS certificates for WebTransport
- Implement authentication for capability access
- Configure appropriate rate limiting
- Enable audit logging for capability calls
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass: cargo test
- Run benchmarks: cargo bench
- Submit a pull request
- Zero panics - No unwrap() in production code, all errors handled explicitly
- All code must pass cargo test and cargo clippy
- Use latest crate versions unless compatibility requires older versions
- Research errors before attempting fixes
- Comprehensive documentation for all public APIs
- See RUST_CODING_STANDARDS.md for complete guidelines
This repository uses CodeRabbit for automated PR reviews. The bot will:
- Check for compliance with our coding standards
- Suggest improvements for error handling and performance
- Verify protocol implementation correctness
- Ensure no unwrap() or panic! in production code
Configuration is in .coderabbit.yaml. The bot's suggestions are educational but not mandatory - maintainers make final decisions.
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
-
API Documentation (GitHub Pages) - Full API documentation for all crates
- capnweb-core - Core protocol types and messages
- capnweb-transport - Transport implementations
- capnweb-server - Server capabilities
- capnweb-client - Client implementation
-
docs.rs - Published crate documentation:
- capnweb-core - Core protocol types
- capnweb-transport - Transport layers
- capnweb-server - Server implementation
- capnweb-client - Client library
- Cap'n Web Protocol Specification - Technical specification
- Development Guide - Implementation guide for contributors
- Coding Standards - Rust coding standards and best practices
- CodeRabbit Setup - Automated code review configuration
All public APIs are documented. To check documentation coverage:
- Certificate-based authentication
- Capability attestation and verification
- Message compression for large payloads
- Streaming capabilities for real-time data
- Protocol versioning and evolution
- Performance optimizations and caching
Built with ❤️ in Rust. Ready for production use.
.png)

