Sends the results of a future to this target
(self, actions: DrawStream)
| 75 | /// Sends the results of a future to this target |
| 76 | /// |
| 77 | pub fn receive<DrawStream: Unpin+Stream<Item=Draw>>(self, actions: DrawStream) -> impl Future { |
| 78 | async move { |
| 79 | let mut actions = actions.ready_chunks(1000); |
| 80 | let target = self; |
| 81 | |
| 82 | while let Some(drawing) = actions.next().await { |
| 83 | target.write(drawing); |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /// |