docs(wit): document capability and component contracts
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
//! Deliberately trapping Component used to verify Actor fault isolation.
|
||||
//!
|
||||
//! Sending the exact bytes `fault` triggers a panic. This crate is a test
|
||||
//! fixture and must not be deployed as an application service.
|
||||
|
||||
mod bindings {
|
||||
// Compile the versioned WIT world into canonical ABI Rust bindings.
|
||||
wit_bindgen::generate!({
|
||||
path: "wit",
|
||||
world: "fault-component",
|
||||
@@ -13,6 +19,8 @@ impl bindings::Guest for Fault {
|
||||
}
|
||||
|
||||
fn invoke(input: Vec<u8>) -> Result<Vec<u8>, bindings::ServiceError> {
|
||||
// A panic becomes a Wasm trap so Runtime tests can assert that one
|
||||
// faulted Actor does not corrupt other service instances.
|
||||
assert_ne!(input, b"fault", "intentional test fault");
|
||||
Ok(input)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user