Skip to main content

HeadlessHost

Struct HeadlessHost 

Source
pub struct HeadlessHost { /* private fields */ }
Expand description

多窗口宿主:每窗口独立 ElementTree/输入/RGBA,共享时钟与软件纹理/glyph 缓存。

这是 P1-6 的平台无关管理层;desktop 多窗口宿主后续复用同一语义 (WindowId → tree/surface/a11y,窗口级 DPI/焦点/关闭回收)。

Implementations§

Source§

impl HeadlessHost

Source

pub fn new() -> Self

Source

pub fn create_window(&mut self, metrics: ShellMetrics) -> ShellWindowId

Source

pub fn close_window(&mut self, id: ShellWindowId) -> bool

关闭窗口;焦点自动落到剩余窗口(按 id 顺序首个)。

Source

pub fn window(&self, id: ShellWindowId) -> Option<&HeadlessShell>

Source

pub fn window_mut(&mut self, id: ShellWindowId) -> Option<&mut HeadlessShell>

Source

pub fn ids(&self) -> impl Iterator<Item = ShellWindowId> + '_

Source

pub fn window_count(&self) -> usize

Source

pub fn focused(&self) -> Option<ShellWindowId>

Source

pub fn set_focused(&mut self, id: ShellWindowId) -> bool

Source

pub fn now_ms(&self) -> u64

Source

pub fn advance(&self, delta_ms: u64) -> u64

Source

pub fn set_time(&self, now_ms: u64)

Source

pub fn frame_all(&mut self) -> usize

渲染全部窗口;返回渲染窗口数。

Trait Implementations§

Source§

impl Default for HeadlessHost

Source§

fn default() -> Self

Returns the “default value” for a type. 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<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, 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.