pub struct HeadlessHost { /* private fields */ }Expand description
多窗口宿主:每窗口独立 ElementTree/输入/RGBA,共享时钟与软件纹理/glyph 缓存。
这是 P1-6 的平台无关管理层;desktop 多窗口宿主后续复用同一语义 (WindowId → tree/surface/a11y,窗口级 DPI/焦点/关闭回收)。
Implementations§
Source§impl HeadlessHost
impl HeadlessHost
pub fn new() -> Self
pub fn create_window(&mut self, metrics: ShellMetrics) -> ShellWindowId
Sourcepub fn close_window(&mut self, id: ShellWindowId) -> bool
pub fn close_window(&mut self, id: ShellWindowId) -> bool
关闭窗口;焦点自动落到剩余窗口(按 id 顺序首个)。
pub fn window(&self, id: ShellWindowId) -> Option<&HeadlessShell>
pub fn window_mut(&mut self, id: ShellWindowId) -> Option<&mut HeadlessShell>
pub fn ids(&self) -> impl Iterator<Item = ShellWindowId> + '_
pub fn window_count(&self) -> usize
pub fn focused(&self) -> Option<ShellWindowId>
pub fn set_focused(&mut self, id: ShellWindowId) -> bool
pub fn now_ms(&self) -> u64
pub fn advance(&self, delta_ms: u64) -> u64
pub fn set_time(&self, now_ms: u64)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HeadlessHost
impl !Send for HeadlessHost
impl !Sync for HeadlessHost
impl !UnwindSafe for HeadlessHost
impl Forget for HeadlessHost
impl Freeze for HeadlessHost
impl Move for HeadlessHost
impl Unpin for HeadlessHost
impl UnsafeUnpin for HeadlessHost
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