Skip to main content

RunnerConfig

Struct RunnerConfig 

Source
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: bool

inner_size 是否按物理像素解释(L2 GPU 性能验收用于精确指定 1080p/4K)

§prefer_software: bool

强制走软件光栅器(不尝试 wgpu;用于 VM/远程桌面验证与无 GPU 环境)

§startup_smoke: bool

启动冒烟:窗口放到屏幕外,校验「首帧先于显示 / a11y 树在可见后推送」后自动退出

Implementations§

Source§

impl RunnerConfig

Source

pub fn new(title: impl Into<String>, width: f32, height: f32) -> Self

Source

pub fn with_physical_size(self, physical: bool) -> Self

将 inner_size 解释为物理像素(默认逻辑像素)。

Source

pub fn with_prefer_software(self, prefer: bool) -> Self

强制软件渲染(桌面应用需实现 mgui-shell-desktop::DesktopRunnerApp::create_software_backend)

Source

pub fn with_startup_smoke(self, smoke: bool) -> Self

启动冒烟模式:完成首帧 + 初始 a11y 树后自动退出,顺序不符则启动失败

Trait Implementations§

Source§

impl Clone for RunnerConfig

Source§

fn clone(&self) -> Self

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
Source§

impl Debug for RunnerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,