Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(async_await)]
- use core::future::Future;
- pub async fn new_session_wrapper<'a, RET, DISPATCH>(mut dispatch: DISPATCH) -> ()
- where
- DISPATCH: FnMut(&'a mut [u8]) -> RET,
- RET: Future<Output = Result<(), ()>> + Send + 'a,
- {
- let mut buf = [0; 10];
- loop {
- dispatch(&mut buf[..]).await;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement