ChaosProtocol

Trait ChaosProtocol 

Source
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§

Source

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

Source

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

Source

fn should_abort(&self) -> Option<String>

Check if chaos should abort the request

Source

fn protocol_name(&self) -> &str

Get protocol name

Implementors§