Skip to main content

MockState

Struct MockState 

Source
pub struct MockState {
    pub widgets: HashMap<u64, MockWidget>,
    pub log: Vec<String>,
    pub sink: Option<EventSink>,
    pub measure_calls: usize,
    pub list_sources: HashMap<u64, ListSource>,
    pub app_menu: Vec<String>,
    pub context_menus: HashMap<u64, Vec<String>>,
    pub windows: Vec<MockWindow>,
    pub no_multi_window: bool,
    pub pending_windows: bool,
    pub pending_opens: Vec<(NodeId, String, String)>,
    /* private fields */
}

Fields§

§widgets: HashMap<u64, MockWidget>§log: Vec<String>§sink: Option<EventSink>§measure_calls: usize

(kind, proposal) measure-call counter for the M1 bounded-measure tests.

§list_sources: HashMap<u64, ListSource>

Recycling-list row-pull sources, keyed by LIST host handle (docs/list.md). A test drives the “viewport” through MockProbe::list_bind, simulating what a native list would do.

§app_menu: Vec<String>

The app menu as last applied (docs/menus.md) — item titles, probe-visible.

§context_menus: HashMap<u64, Vec<String>>

Context menus by widget handle (docs/menus.md) — item titles per handle.

§windows: Vec<MockWindow>

Secondary windows (docs/windows.md), in open order — probe-visible.

§no_multi_window: bool

open_window answers Unsupported (the cover-fallback test harness).

§pending_windows: bool

open_window answers Pending (the async-completion test harness); the test finishes the open through MockProbe::complete_window.

§pending_opens: Vec<(NodeId, String, String)>

Parked Pending opens: (node, title, kind).

Trait Implementations§

Source§

impl Default for MockState

Source§

fn default() -> MockState

Returns the “default value” for a type. 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> 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, 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.
Day API ↩ Guides· daybrite.dev