pub struct MockConfig {
pub pre_stream_error: Option<MockError>,
pub mid_stream_drop_after: Option<usize>,
pub tokens: Vec<String>,
pub token_delay_ms: Option<u64>,
}Expand description
Configuration for Mock failure-mode injection.
Fields§
§pre_stream_error: Option<MockError>If Some, generate() returns this error immediately. Defaults to
None (success).
mid_stream_drop_after: Option<usize>If Some(N), the stream yields N tokens then ends without a Done
event, simulating a mid-stream backend failure.
tokens: Vec<String>Tokens to emit (if mid_stream_drop_after is None they all stream
followed by a Done). Default: a single canned response so callers
without a config still get something useful.
token_delay_ms: Option<u64>Optional sleep between emitted tokens, in milliseconds. Used by
the concurrency stress harness to make per-request work
observable so admission queueing actually engages. None means
no delay (the historical behaviour).
Trait Implementations§
Source§impl Clone for MockConfig
impl Clone for MockConfig
Source§fn clone(&self) -> MockConfig
fn clone(&self) -> MockConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MockConfig
impl Debug for MockConfig
Source§impl Default for MockConfig
impl Default for MockConfig
Source§fn default() -> MockConfig
fn default() -> MockConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MockConfig
impl RefUnwindSafe for MockConfig
impl Send for MockConfig
impl Sync for MockConfig
impl Unpin for MockConfig
impl UnsafeUnpin for MockConfig
impl UnwindSafe for MockConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more