pub struct MockBackend { /* private fields */ }Expand description
Scripted AgentBackend: start() pops scripts FIFO and records every
spec it saw. Injected user messages are recorded per session, aligned with
start order.
Implementations§
Source§impl MockBackend
impl MockBackend
pub fn new() -> Self
Sourcepub fn with_scripts(scripts: Vec<MockScript>) -> Self
pub fn with_scripts(scripts: Vec<MockScript>) -> Self
Backend pre-loaded with scripts (consumed FIFO by start()).
Sourcepub fn push_script(&self, script: MockScript)
pub fn push_script(&self, script: MockScript)
Queue another script at the back.
Sourcepub fn started_specs(&self) -> Vec<SessionSpec>
pub fn started_specs(&self) -> Vec<SessionSpec>
Clones of every spec passed to start(), in start order.
Sourcepub fn injected_messages(&self) -> Vec<Vec<String>>
pub fn injected_messages(&self) -> Vec<Vec<String>>
User messages injected per session, aligned with start order.
Trait Implementations§
Source§impl AgentBackend for MockBackend
impl AgentBackend for MockBackend
Auto Trait Implementations§
impl !Freeze for MockBackend
impl !RefUnwindSafe for MockBackend
impl !UnwindSafe for MockBackend
impl Send for MockBackend
impl Sync for MockBackend
impl Unpin for MockBackend
impl UnsafeUnpin for MockBackend
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