pub struct MockProbe {
pub state: Rc<RefCell<MockState>>,
}Fields§
§state: Rc<RefCell<MockState>>Implementations§
Source§impl MockProbe
impl MockProbe
pub fn log(&self) -> Vec<String>
pub fn clear_log(&self)
pub fn measure_calls(&self) -> usize
pub fn widget(&self, h: MockHandle) -> MockWidget
pub fn find_by_kind(&self, kind: &str) -> Vec<(MockHandle, MockWidget)>
Sourcepub fn list_len(&self, host: MockHandle) -> usize
pub fn list_len(&self, host: MockHandle) -> usize
Row count a LIST host would query from its data-source.
Sourcepub fn list_bind(&self, host: MockHandle, index: usize, cell: MockHandle)
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.)
Sourcepub fn list_can_move(&self, host: MockHandle, from: usize, to: usize) -> i64
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()).
Sourcepub fn list_move(&self, host: MockHandle, from: usize, to: usize) -> bool
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.)
Sourcepub fn emit(&self, node: NodeId, event: Event)
pub fn emit(&self, node: NodeId, event: Event)
Inject a native event through the real sink (as the toolkit trampoline would).
Sourcepub fn windows(&self) -> Vec<MockWindow>
pub fn windows(&self) -> Vec<MockWindow>
The secondary windows opened so far (closed ones stay listed with open: false).
Sourcepub fn set_no_multi_window(&self, v: bool)
pub fn set_no_multi_window(&self, v: bool)
Make open_window answer Unsupported — the cover-fallback test harness.
Sourcepub fn set_pending_windows(&self, v: bool)
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.
Sourcepub fn complete_window(&self, node: NodeId, size: Size) -> Option<RawHandle>
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.
Sourcepub fn resize_window(&self, node: NodeId, size: Size)
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.
Sourcepub fn close_window_natively(&self, node: NodeId)
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.
Sourcepub fn log_len(&self) -> usize
pub fn log_len(&self) -> usize
The current op-log length — pair with Self::log_since to scope assertions.