pub trait VortexPlugin: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn check_fault(
&self,
ctx: &mut PluginContext<'_>,
operation: &str,
) -> FaultCheck;
// Provided methods
fn on_register(&self) { ... }
fn on_shutdown(&self) { ... }
}Expand description
Trait for custom fault injection plugins.
Implement this to add custom fault types (e.g., gRPC errors, DNS failures, TLS handshake faults) that integrate with Vortex’s simulation layers.
Required Methods§
Sourcefn check_fault(
&self,
ctx: &mut PluginContext<'_>,
operation: &str,
) -> FaultCheck
fn check_fault( &self, ctx: &mut PluginContext<'_>, operation: &str, ) -> FaultCheck
Check if a fault should be injected for the given operation.
Called by the simulation engine before each intercepted operation.
The operation string describes what’s happening (e.g., “fs:write:/data.wal”,
“net:connect:127.0.0.1:5432”, “grpc:call:UserService/GetUser”).
Provided Methods§
Sourcefn on_register(&self)
fn on_register(&self)
Called once when the plugin is registered. Use for setup.
Sourcefn on_shutdown(&self)
fn on_shutdown(&self)
Called once when the simulation ends. Use for cleanup/reporting.