Expand description
Plugin trait for custom fault injection modules.
Implement VortexPlugin to add custom fault types that integrate
with all Vortex layers. Plugins are registered at runtime and evaluated
alongside the built-in fault rules.
§Example
use vortex_core::plugin::{VortexPlugin, FaultCheck, PluginContext};
use vortex_core::DetRng;
struct GrpcPlugin;
impl VortexPlugin for GrpcPlugin {
fn name(&self) -> &str { "grpc" }
fn check_fault(&self, ctx: &mut PluginContext, operation: &str) -> FaultCheck {
if operation.starts_with("grpc:") && ctx.rng.chance(0.1) {
FaultCheck::Inject { message: "gRPC unavailable".into() }
} else {
FaultCheck::Pass
}
}
}Structs§
- Plugin
Context - Context passed to plugins during fault evaluation.
- Plugin
Registry - Registry of active plugins.
Enums§
- Fault
Check - Result of a plugin fault check.
Traits§
- Vortex
Plugin - Trait for custom fault injection plugins.