| Crates.io | capnweb-core |
| lib.rs | capnweb-core |
| version | 0.1.0 |
| created_at | 2025-09-30 00:49:20.684432+00 |
| updated_at | 2025-09-30 00:49:20.684432+00 |
| description | Core protocol implementation for Cap'n Web RPC - capability-based security with promise pipelining |
| homepage | https://github.com/currentspace/capn-rs |
| repository | https://github.com/currentspace/capn-rs |
| max_upload_size | |
| id | 1860431 |
| size | 438,166 |
Core protocol implementation for Cap'n Web RPC - capability-based security with promise pipelining.
capnweb-core provides the foundational types and protocol implementation for the Cap'n Web RPC system. It includes:
Add to your Cargo.toml:
[dependencies]
capnweb-core = "0.1.0"
Basic usage:
use capnweb_core::{CapId, Message, CallId, RpcError};
use serde_json::json;
// Create a capability ID
let cap_id = CapId::new(1);
// Example: create a message
let message = Message::Call {
id: CallId::new(1),
target: cap_id,
method: "echo".to_string(),
args: vec![json!("hello")],
};
// Handle protocol messages
match message {
Message::Call { target, method, args, .. } => {
// Process RPC call
println!("Call to {}: {}", target, method);
}
Message::Result { value, .. } => {
// Handle result
println!("Result: {:?}", value);
}
Message::Error { error, .. } => {
// Handle error
println!("Error: {}", error);
}
}
validation (default): Enable JSON schema validationsimd: Use SIMD-accelerated JSON parsingThis project is licensed under either of
at your option.