pub struct ReplayTransport { /* private fields */ }Expand description
Implementations§
Source§impl ReplayTransport
impl ReplayTransport
Sourcepub fn new(events: impl IntoIterator<Item = Event>) -> Self
pub fn new(events: impl IntoIterator<Item = Event>) -> Self
A transport that answers the first run with these events, and every later run with an error.
Sourcepub fn with_runs(runs: impl IntoIterator<Item = Vec<Event>>) -> Self
pub fn with_runs(runs: impl IntoIterator<Item = Vec<Event>>) -> Self
A transport that answers each run with the next list in the script.
This is what a human-in-the-loop round trip needs: the first run pauses on an interrupt, the second — the resume — carries on.
Sourcepub fn matching_requests(self) -> Self
pub fn matching_requests(self) -> Self
Rebind each script’s first RUN_STARTED and its matching RUN_FINISHED to the actual request IDs, including IDs in the start event’s input echo. The echo preserves the recorded history. Unmatched terminal IDs stay unchanged so malformed fixtures still fail. The default replays events literally.
In a script of several runs this makes the first one the requested
run. To script runs replayed ahead of it, leave this off and give the
last run the id set with
Thread::set_next_run_id.
Sourcepub fn requests(&self) -> Vec<RunAgentInput>
pub fn requests(&self) -> Vec<RunAgentInput>
Every request this transport has been handed, in order.
Sourcepub fn last_request(&self) -> Option<RunAgentInput>
pub fn last_request(&self) -> Option<RunAgentInput>
The most recent request, if there has been one.