pub enum MockBehavior {
Success {
output: Value,
tokens: TokenUsage,
delay: Duration,
},
Fail {
kind: FailKind,
delay: Duration,
},
Hang,
}Expand description
How a mocked run() call should behave. Behaviours are consumed by call
order; the last entry repeats once exhausted.
Variants§
Success
Fail
Fail with a fresh BackendError of the given kind (errors aren’t
Clone, so we reconstruct on each call).
Hang
Never returns until cancelled; then yields BackendError::Cancelled.
Implementations§
Trait Implementations§
Source§impl Clone for MockBehavior
impl Clone for MockBehavior
Source§fn clone(&self) -> MockBehavior
fn clone(&self) -> MockBehavior
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 moreAuto Trait Implementations§
impl Freeze for MockBehavior
impl RefUnwindSafe for MockBehavior
impl Send for MockBehavior
impl Sync for MockBehavior
impl Unpin for MockBehavior
impl UnsafeUnpin for MockBehavior
impl UnwindSafe for MockBehavior
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