pub struct AsyncLoopConfig {
pub frame_interval: Duration,
pub max_steps: Option<u32>,
pub exit_on_idle: bool,
}Expand description
通用异步事件循环配置参数。
Fields§
§frame_interval: Duration活跃帧期间的目标刷新间隔(默认 16ms 对应 60Hz;Duration::ZERO 表示每帧仅 yield_now)。
max_steps: Option<u32>可选最大步进帧数上限(None 表示持续运行至 PlatformControlFlow::Exit)。
exit_on_idle: bool当画面首次进入 PlatformControlFlow::Wait 空闲态时是否直接退出循环(默认 false:挂起等待唤醒)。
Implementations§
Source§impl AsyncLoopConfig
impl AsyncLoopConfig
Sourcepub const fn with_max_steps(self, max_steps: u32) -> Self
pub const fn with_max_steps(self, max_steps: u32) -> Self
设置最大步进帧数上限(常用于测试与确定性演练)。
Sourcepub const fn with_exit_on_idle(self, exit_on_idle: bool) -> Self
pub const fn with_exit_on_idle(self, exit_on_idle: bool) -> Self
设置是否在首次静止(PlatformControlFlow::Wait)时立即退出循环。
Trait Implementations§
Source§impl Clone for AsyncLoopConfig
impl Clone for AsyncLoopConfig
impl Copy for AsyncLoopConfig
Source§impl Debug for AsyncLoopConfig
impl Debug for AsyncLoopConfig
Source§impl Default for AsyncLoopConfig
impl Default for AsyncLoopConfig
impl Eq for AsyncLoopConfig
Source§impl PartialEq for AsyncLoopConfig
impl PartialEq for AsyncLoopConfig
impl StructuralPartialEq for AsyncLoopConfig
Auto Trait Implementations§
impl Forget for AsyncLoopConfig
impl Freeze for AsyncLoopConfig
impl Move for AsyncLoopConfig
impl RefUnwindSafe for AsyncLoopConfig
impl Send for AsyncLoopConfig
impl Sync for AsyncLoopConfig
impl Unpin for AsyncLoopConfig
impl UnsafeUnpin for AsyncLoopConfig
impl UnwindSafe for AsyncLoopConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。