Re:Rust Playground
by mkesper on Thursday July 09, 2020 @10:35AM
(#23780719)
Examples from the book shouldn't be too hard or at least some link to it?
[ Parent
| on HN ]
Re:Rust Playground
by steveklabnik on Thursday July 09, 2020 @10:39AM
(#23780758)
Sure. Here's a random page on the book: https://doc.rust-lang.org/stable/book/ch08-01-vectors.html
You can click the arrows to run the code. This effectively makes an AJAX call to the playpen, and puts the results back on the page.
Here's a random page from the API docs: https://doc.rust-lang.org/stable/std/string/struct.String.ht...
Those "run" buttons will open up the example in the playpen so you can play around with it.
I think ideally these would all let you edit in place, run in the page, or open in the playpen, but they use slightly different tooling and nobody has put in the work to make it all identical yet.