Skip to main content

MockProbe

Struct MockProbe 

Source
pub struct MockProbe {
    pub state: Rc<RefCell<MockState>>,
}

Fields§

§state: Rc<RefCell<MockState>>

Implementations§

Source§

impl MockProbe

Source

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

Source

pub fn clear_log(&self)

Source

pub fn measure_calls(&self) -> usize

Source

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

Ops excluding measures (mutation ops only).

Source

pub fn widget(&self, h: MockHandle) -> MockWidget

Source

pub fn find_by_kind(&self, kind: &str) -> Vec<(MockHandle, MockWidget)>

Source

pub fn list_len(&self, host: MockHandle) -> usize

Row count a LIST host would query from its data-source.

Source

pub fn list_bind(&self, host: MockHandle, index: usize, cell: MockHandle)

Simulate the native list binding row index into a physical cell — Day builds the row the first time a cell is used and rebinds (slot-write) when it is recycled. Drives the real day-core driver, so tests exercise the whole recycling path. (The source Rc is cloned out before the call so the re-entrant with_tree/toolkit work holds no MockState borrow.)

Source

pub fn list_can_move(&self, host: MockHandle, from: usize, to: usize) -> i64

Consult the list’s reorder guard the way a native validate hook would: the accepted target index, or -1 when the guard denies. i64::MIN when the list has no reorder seam (not .reorderable()).

Source

pub fn list_move(&self, host: MockHandle, from: usize, to: usize) -> bool

Simulate a native drop: consult the guard, commit on accept (rotating Day’s snapshot and deferring the app’s on_reorder, exactly as a native backend would). Returns whether the move committed. (Reorder Rcs are cloned out before the call, like Self::list_bind.)

Source

pub fn emit(&self, node: NodeId, event: Event)

Inject a native event through the real sink (as the toolkit trampoline would).

Source

pub fn windows(&self) -> Vec<MockWindow>

The secondary windows opened so far (closed ones stay listed with open: false).

Source

pub fn set_no_multi_window(&self, v: bool)

Make open_window answer Unsupported — the cover-fallback test harness.

Source

pub fn set_pending_windows(&self, v: bool)

Make open_window answer Pending — the async-completion test harness. Finish an open with Self::complete_window + day_core::finish_window_open.

Source

pub fn complete_window(&self, node: NodeId, size: Size) -> Option<RawHandle>

Materialize the parked Pending open for node: registers the content-container widget + window record (as the native side finishing creation would) and returns the raw handle to pass to day_core::finish_window_open. None = no such pending open.

Source

pub fn resize_window(&self, node: NodeId, size: Size)

Resize a secondary window (as a native drag would): updates the record and reports WindowResized to the window’s root.

Source

pub fn close_window_natively(&self, node: NodeId)

Close a secondary window from the native side (the title-bar path): marks it closed and reports WindowClosed to the window’s root.

Source

pub fn log_len(&self) -> usize

The current op-log length — pair with Self::log_since to scope assertions.

Source

pub fn log_since(&self, mark: usize) -> Vec<String>

The op-log entries recorded after mark (from Self::log_len).

Trait Implementations§

Source§

impl Clone for MockProbe

Source§

fn clone(&self) -> MockProbe

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

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> 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> 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.
Day API ↩ Guides· daybrite.dev