pub struct MockConfig {
pub max_retained: usize,
pub copy_on_exchange: bool,
pub fail_fast: bool,
pub assert_period_ms: u64,
pub any_order: bool,
}Expand description
Configuration for MockComponent.
Controls how many exchanges are retained before the oldest are dropped, and other behavioural flags for assertions.
§Examples
use camel_component_mock::MockConfig;
let config = MockConfig {
max_retained: 100,
copy_on_exchange: true,
fail_fast: false,
assert_period_ms: 0,
any_order: false,
};Fields§
§max_retained: usizeMaximum number of exchanges to retain. When exceeded, the oldest exchange is dropped. Defaults to 10 000.
copy_on_exchange: boolWhen true, clone the exchange body before storing it in the received
exchanges list. This prevents aliasing when the caller mutates the
original exchange after sending. Defaults to false.
fail_fast: boolWhen true, after the first failing assertion the mock stops processing
exchanges and records the error. Defaults to false.
assert_period_ms: u64Time in milliseconds to wait before asserting expectations (to allow
async processing to complete). Defaults to 0 (no wait).
any_order: boolWhen true, MockEndpointInner::assert_satisfied matches expected
bodies in any order rather than strict sequence. Defaults to false.
Implementations§
Trait Implementations§
Source§impl Clone for MockConfig
impl Clone for MockConfig
Source§fn clone(&self) -> MockConfig
fn clone(&self) -> MockConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more