pub struct Harness<P: UiPlugin> { /* private fields */ }Implementations§
Source§impl<P: UiPlugin> Harness<P>
impl<P: UiPlugin> Harness<P>
Sourcepub fn activate(host: MockHost, config: &str) -> Self
pub fn activate(host: MockHost, config: &str) -> Self
Installs host and activates the plugin with config.
Sourcepub fn resize(&mut self, surface: &str, geometry: Geometry)
pub fn resize(&mut self, surface: &str, geometry: Geometry)
Lays a surface out at geometry and delivers the resize event.
Sourcepub fn frame(
&mut self,
now_ms: u64,
interval_ms: u32,
power: Power,
) -> Option<u64>
pub fn frame( &mut self, now_ms: u64, interval_ms: u32, power: Power, ) -> Option<u64>
Calls frame with the paced interval and power state a viewer
passes; returns when the plugin wants the next one.
pub fn event(&mut self, event: Event)
Sourcepub fn show(&mut self, surface: &str, visible: bool)
pub fn show(&mut self, surface: &str, visible: bool)
Shows or hides a surface, as the viewer does when it places it.
Sourcepub fn set_capabilities(&mut self, capabilities: Capabilities)
pub fn set_capabilities(&mut self, capabilities: Capabilities)
Changes what the viewer can show and tells the plugin.
Sourcepub fn set_model(&mut self, surface: &str, model: Model)
pub fn set_model(&mut self, surface: &str, model: Model)
Switches a multi-model surface to model, as the viewer does when
its graphics support changes.
Sourcepub fn pointer(&mut self, surface: &str, kind: PointerKind, x: u32, y: u32)
pub fn pointer(&mut self, surface: &str, kind: PointerKind, x: u32, y: u32)
A pointer event at (x, y) in the surface’s units.
Sourcepub fn answer_calls(&mut self) -> usize
pub fn answer_calls(&mut self) -> usize
Answers every call-async the plugin made so far from
MockHost::call_answers, delivering one
Event::CallResult each, in order. Returns how many.
Sourcepub fn take_frame_request(&mut self) -> Option<u64>
pub fn take_frame_request(&mut self) -> Option<u64>
The frame the plugin asked for from an event, and clears it.
pub fn commits(&self, surface: &str) -> Vec<MockCommit>
pub fn host<R>(&self, f: impl FnOnce(&mut MockHost) -> R) -> R
pub fn deactivate(self)
Auto Trait Implementations§
impl<P> !Freeze for Harness<P>
impl<P> !RefUnwindSafe for Harness<P>
impl<P> Send for Harness<P>where
UiRuntime<P>: Send,
impl<P> Sync for Harness<P>where
UiRuntime<P>: Sync,
impl<P> Unpin for Harness<P>where
UiRuntime<P>: Unpin,
impl<P> UnsafeUnpin for Harness<P>where
UiRuntime<P>: UnsafeUnpin,
impl<P> UnwindSafe for Harness<P>where
UiRuntime<P>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more