added main example
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Implementing our own Future
|
||||
|
||||
```rust
|
||||
|
||||
use std::{
|
||||
future::Future, pin::Pin, sync::{mpsc::{channel, Sender}, Arc, Mutex},
|
||||
task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
|
||||
@@ -192,4 +192,14 @@ impl Drop for Reactor {
|
||||
self.handle.take().map(|h| h.join().unwrap()).unwrap();
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
> Unfortunately there seems to be a bug which causes a compiler error when
|
||||
> trying to run code including the `async` keyword in Mdbook. I've filed an [issue
|
||||
> for it][mdbook_issue] Until that is
|
||||
> resolved you can test and run it in [the playground][playground_example].
|
||||
|
||||
|
||||
|
||||
[playground_example]:https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ca43dba55c6e3838c5494de45875677f
|
||||
[mdbook_issue]: https://github.com/rust-lang/mdBook/issues/1134
|
||||
|
||||
Reference in New Issue
Block a user