Skip to main content

FakeHandle

Struct FakeHandle 

Source
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

Source

pub fn push_script(&self, outcome: ScriptedOutcome)

Appends a scripted outcome to the back of the script queue.

Source

pub fn set_log_unavailable(&self, reason: impl Into<String>)

Makes reconcile report the issuing session’s log as unreachable.

Source

pub fn clear_log_unavailable(&self)

Restores log availability.

Source

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).

Source

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).

Source

pub fn set_screenshot_omission(&self, reason: Option<ScreenshotOmissionReason>)

Injects a screenshot omission for subsequent observations.

Source

pub fn set_ui_snapshot_omission(&self, reason: Option<UiSnapshotOmissionReason>)

Injects a UI-snapshot omission for subsequent observations and ui_snapshot calls.

Source

pub fn insert_evidence(&self, asset_id: impl Into<String>, bytes: Vec<u8>)

Registers evidence bytes addressable via AssetRef.id.

Source

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.

Source

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.

Source

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.

Source

pub fn recorded_verdicts(&self) -> Vec<VerdictWrite>

The verdicts accepted by record_verdict so far.

Source

pub fn dispatched_call_ids(&self) -> Vec<String>

The callIds journaled as dispatched, in dispatch order.

Source

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

Source§

fn clone(&self) -> FakeHandle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FakeHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.