pub struct StdAsyncDriver { /* private fields */ }Expand description
将任意 SchedulerBackend 与 UiWakeSignal 组合为 AsyncDriver,
用于直接驱动 super::run_async_event_loop。
Implementations§
Source§impl StdAsyncDriver
impl StdAsyncDriver
Sourcepub fn new() -> Self
pub fn new() -> Self
使用默认内置 NativeStdScheduler 创建标准异步主循环驱动器。
Sourcepub fn with_backend(backend: Arc<dyn SchedulerBackend>) -> Self
pub fn with_backend(backend: Arc<dyn SchedulerBackend>) -> Self
使用指定的 SchedulerBackend 创建异步主循环驱动器。
Sourcepub fn wake_signal(&self) -> &UiWakeSignal
pub fn wake_signal(&self) -> &UiWakeSignal
获取关联的黏性唤醒信号句柄(用于绑定至 engine.set_async_waker(driver.wake_signal().notifier()))。
Sourcepub fn backend(&self) -> &Arc<dyn SchedulerBackend> ⓘ
pub fn backend(&self) -> &Arc<dyn SchedulerBackend> ⓘ
获取底层 SchedulerBackend 引用。
Trait Implementations§
Source§impl AsyncDriver for StdAsyncDriver
impl AsyncDriver for StdAsyncDriver
Source§fn capabilities(&self) -> SchedulerCapabilities
fn capabilities(&self) -> SchedulerCapabilities
返回当前调度器的能力元信息。
Source§impl Clone for StdAsyncDriver
impl Clone for StdAsyncDriver
Source§impl Default for StdAsyncDriver
impl Default for StdAsyncDriver
Auto Trait Implementations§
impl !RefUnwindSafe for StdAsyncDriver
impl !UnwindSafe for StdAsyncDriver
impl Forget for StdAsyncDriver
impl Freeze for StdAsyncDriver
impl Move for StdAsyncDriver
impl Send for StdAsyncDriver
impl Sync for StdAsyncDriver
impl Unpin for StdAsyncDriver
impl UnsafeUnpin for StdAsyncDriver
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<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) 时执行闭包修饰自身,否则原样返回。