Rust 是否需要另⼀种“⾊彩”的 Future? - 郭⼦兴outer Future 时不同步取消 inner Future 将可能 产⽣未定义⾏为; #[completion] async fn foo() {} pub trait CompletionFuture { type Output; unsafe fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) �� Poll; 相对于现有的“红⾊” async 块: “红⾊” 只能 await “红⾊”,但“蓝⾊”可以 await “蓝⾊”与“红 ⾊”,以确保 cancel 信号能正确地递归响应。 pub trait CompletionFuture { type Output; unsafe fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) �� Poll ; 0 码力 | 19 页 | 7.77 MB | 1 年前3
共 1 条
- 1
 
相关搜索词













