Sends some drawing instructions to this target
(&self, drawing: Drawing)
| 45 | /// Sends some drawing instructions to this target |
| 46 | /// |
| 47 | pub fn write<Drawing: Send+IntoIterator<Item=Draw>>(&self, drawing: Drawing) { |
| 48 | // Write the drawing instructions to the pending queue |
| 49 | let waker = self.stream_core.sync(move |core| { |
| 50 | core.write(drawing.into_iter()); |
| 51 | core.take_waker() |
| 52 | }); |
| 53 | |
| 54 | // Wake the stream, if anything is listening |
| 55 | waker.map(|waker| waker.wake()); |
| 56 | } |
| 57 | |
| 58 | /// |
| 59 | /// Provides a way to draw on this target via a graphics context |