← 返回卡片

原书出处

Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)

06 Chapter 6. Reactive Programming 回调生命周期与渲染入口

First Edition · 核验版本的摘录快照 · 导入于 2026-11-25T07:07:54.321Z

{ HeaterFuture::new().await; }); display.await.unwrap(); heat_loss.await.unwrap(); heater.await.unwrap(); }

Notice the _guard, which is the callback guard. The callback guard in the device_query crate is returned when adding a callback. If we drop the guard, the event listener is removed. Luckily for us, our main thread is blocked until we exit the program because our display, heat loss, and heater tasks will continually poll until we force the program to exit.

The on_key_down function creates a thread and

此预览只包含定位所需的摘录和上下文。

原书定位详情

来源:a19c7933-4eda-4176-aebd-30fe7e1ad292

正文位置:extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch06.html#id43

EPUB SHA-256:109ff0224da54833b0d49c82502e850845274913fe34a7168dcf36a9c075b4e0