Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #![feature(async_await)]
  2. use core::future::Future;
  3.  
  4. pub async fn new_session_wrapper<'a, RET, DISPATCH>(mut dispatch: DISPATCH) -> ()
  5. where
  6. DISPATCH: FnMut(&'a mut [u8]) -> RET,
  7. RET: Future<Output = Result<(), ()>> + Send + 'a,
  8. {
  9. let mut buf = [0; 10];
  10. loop {
  11. dispatch(&mut buf[..]).await;
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement