pub trait ChaosProtocol: Send + Sync {
// Required methods
fn apply_pre_request<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn apply_post_response<'life0, 'async_trait>(
&'life0 self,
response_size: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn should_abort(&self) -> Option<String>;
fn protocol_name(&self) -> &str;
}Expand description
Protocol-agnostic chaos trait
Required Methods§
Sourcefn apply_pre_request<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_pre_request<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Apply chaos before processing a request
Sourcefn apply_post_response<'life0, 'async_trait>(
&'life0 self,
response_size: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_post_response<'life0, 'async_trait>(
&'life0 self,
response_size: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Apply chaos after processing a response
Sourcefn should_abort(&self) -> Option<String>
fn should_abort(&self) -> Option<String>
Check if chaos should abort the request
Sourcefn protocol_name(&self) -> &str
fn protocol_name(&self) -> &str
Get protocol name