Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #![feature(async_await)]
  2. #![allow(unused_variables, dead_code)]
  3.  
  4. use futures::future::{self, Future, FutureExt};
  5.  
  6. fn main() {
  7. let result = run();
  8. }
  9.  
  10. async fn run() -> String {
  11. let mut input = input_data().await;
  12. let nodes: Vec<Node> = Vec::new();
  13.  
  14. for node in nodes {
  15. input = node.run(input);
  16. }
  17.  
  18. input
  19. }
  20.  
  21. async fn input_data() -> String {
  22. String::new()
  23. }
  24.  
  25. struct Node {
  26. id: i32,
  27. }
  28.  
  29. impl Node {
  30. fn run(&self, s: String) -> String {
  31. format!("{}, {}", s, id)
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement