Advertisement
Guest User

Untitled

a guest
May 25th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. pub struct ThreadScope<'a> {
  2.  
  3. }
  4.  
  5. // Not sure about this, but doesn't seem necessary or
  6. // particularly useful to be able to pass it to another thread
  7. impl<'a> !Sync for ThreadScope<'a> { }
  8.  
  9. fn scope<'a,F,R>(f: F) -> R
  10. where F: FnOnce(&ThreadScope<'a>)
  11.  
  12. impl ThreadScope<'a> {
  13. fn spawn<F,R>(&self, f: F) -> Future<'a,R>
  14. where F: FnOnce()->R + Send + 'a
  15. }
  16.  
  17. struct Future<'a,R> {
  18. }
  19.  
  20. impl<'a,R> Future<'a,R> {
  21. fn join(self) -> R
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement