pub struct RunnerConfig {
pub title: String,
pub inner_size: Size,
pub physical_size: bool,
pub prefer_software: bool,
pub startup_smoke: bool,
}Expand description
窗口启动配置
Fields§
§title: String§inner_size: Size窗口初始尺寸;默认按逻辑像素解释,physical_size = true 时按物理像素
physical_size: boolinner_size 是否按物理像素解释(L2 GPU 性能验收用于精确指定 1080p/4K)
prefer_software: bool强制走软件光栅器(不尝试 wgpu;用于 VM/远程桌面验证与无 GPU 环境)
startup_smoke: bool启动冒烟:窗口放到屏幕外,校验「首帧先于显示 / a11y 树在可见后推送」后自动退出
Implementations§
Source§impl RunnerConfig
impl RunnerConfig
pub fn new(title: impl Into<String>, width: f32, height: f32) -> Self
Sourcepub fn with_physical_size(self, physical: bool) -> Self
pub fn with_physical_size(self, physical: bool) -> Self
将 inner_size 解释为物理像素(默认逻辑像素)。
Sourcepub fn with_prefer_software(self, prefer: bool) -> Self
pub fn with_prefer_software(self, prefer: bool) -> Self
强制软件渲染(桌面应用需实现 mgui-shell-desktop::DesktopRunnerApp::create_software_backend)
Sourcepub fn with_startup_smoke(self, smoke: bool) -> Self
pub fn with_startup_smoke(self, smoke: bool) -> Self
启动冒烟模式:完成首帧 + 初始 a11y 树后自动退出,顺序不符则启动失败
Trait Implementations§
Source§impl Clone for RunnerConfig
impl Clone for RunnerConfig
Auto Trait Implementations§
impl Freeze for RunnerConfig
impl RefUnwindSafe for RunnerConfig
impl Send for RunnerConfig
impl Sync for RunnerConfig
impl Unpin for RunnerConfig
impl UnsafeUnpin for RunnerConfig
impl UnwindSafe for RunnerConfig
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