pub struct FakeHandle { /* private fields */ }Expand description
A cheap, clonable handle into the fake’s world for programming and inspection from tests (fault injection, recorded-state assertions).
Implementations§
Source§impl FakeHandle
impl FakeHandle
Sourcepub fn push_script(&self, outcome: ScriptedOutcome)
pub fn push_script(&self, outcome: ScriptedOutcome)
Appends a scripted outcome to the back of the script queue.
Makes reconcile report the issuing session’s log as unreachable.
Restores log availability.
Sourcepub fn set_fetch_evidence_unsupported(&self, reason: Option<String>)
pub fn set_fetch_evidence_unsupported(&self, reason: Option<String>)
Makes fetch_evidence fail with a typed unsupported error (None
restores it). Models a control plane without an asset byte channel
— the runner degrades localization to a typed gap (M2).
Sourcepub fn set_record_verdict_error(&self, reason: Option<String>)
pub fn set_record_verdict_error(&self, reason: Option<String>)
Makes record_verdict fail with a typed transport error (None
restores it). Models a wire failure of remote verdict archival —
the runner annotates it and never aborts the run (04 §5).
Sourcepub fn set_screenshot_omission(&self, reason: Option<ScreenshotOmissionReason>)
pub fn set_screenshot_omission(&self, reason: Option<ScreenshotOmissionReason>)
Injects a screenshot omission for subsequent observations.
Sourcepub fn set_ui_snapshot_omission(&self, reason: Option<UiSnapshotOmissionReason>)
pub fn set_ui_snapshot_omission(&self, reason: Option<UiSnapshotOmissionReason>)
Injects a UI-snapshot omission for subsequent observations and
ui_snapshot calls.
Sourcepub fn insert_evidence(&self, asset_id: impl Into<String>, bytes: Vec<u8>)
pub fn insert_evidence(&self, asset_id: impl Into<String>, bytes: Vec<u8>)
Registers evidence bytes addressable via AssetRef.id.
Sourcepub fn inject_ui_snapshot(&self, snapshot: Option<Value>)
pub fn inject_ui_snapshot(&self, snapshot: Option<Value>)
Injects the synthetic UiSnapshot that subsequent observe calls
serve: the produced UiSnapshotRef evidence bytes are the
snapshot’s canonical JSON (fetchable via fetch_evidence) and
ui_snapshot(observationId) returns the injected content. None
restores the placeholder bytes.
Sourcepub fn make_observation(&self, ui_snapshot: Option<Value>) -> Observation
pub fn make_observation(&self, ui_snapshot: Option<Value>) -> Observation
Synthesizes an Observation carrying a registered screenshot
asset and — when ui_snapshot is given — a UiSnapshotRef whose
evidence bytes are the snapshot’s canonical JSON, with
ui_snapshot(observationId) serving the same injected tree. Embed
it into a scripted ActionResult (before/after) to drive the
runner’s uiTree/vision verify channels programmatically.
Sourcepub fn make_observation_for(
&self,
device_id: &str,
ui_snapshot: Option<Value>,
) -> Observation
pub fn make_observation_for( &self, device_id: &str, ui_snapshot: Option<Value>, ) -> Observation
Self::make_observation with an explicit device id — the
observation record lands in the ledger, so a harness binding a
non-default device must not journal the wrong identity.
Sourcepub fn recorded_verdicts(&self) -> Vec<VerdictWrite>
pub fn recorded_verdicts(&self) -> Vec<VerdictWrite>
The verdicts accepted by record_verdict so far.
Sourcepub fn dispatched_call_ids(&self) -> Vec<String>
pub fn dispatched_call_ids(&self) -> Vec<String>
The callIds journaled as dispatched, in dispatch order.
Sourcepub fn ended_outcome(&self) -> Option<(SessionOutcome, Option<String>)>
pub fn ended_outcome(&self) -> Option<(SessionOutcome, Option<String>)>
The outcome recorded by the first effective end call, if any.
Trait Implementations§
Source§impl Clone for FakeHandle
impl Clone for FakeHandle
Source§fn clone(&self) -> FakeHandle
fn clone(&self) -> FakeHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more