pub fn enter<F, R>(&mut self, f: F) -> R
    where
        F: FnOnce() -> R,
    {
        self.notify.clear();

        let res = spawn(future::lazy(|| Ok::<_, ()>(f()))).poll_future_notify(&self.notify, 0);

        match res.unwrap() {
            Async::Ready(v) => v,
            _ => unreachable!(),
        }
    }
/// Run a closure from the context of the task.
///
/// Any notifications resulting from the execution of the closure are
/// tracked.
Run a closure from the context of the task.
Any notifications resulting from the execution of the closure are
tracked.
Run a closure from the context of the task . Any notifications resulting from the execution of the closure are tracked .
pub fn enter<F, R>(&mut self, f: F) -> R
    where
        F: FnOnce() -> R,
    {
        self.notify.clear();
        let res = spawn(future::lazy(|| Ok::<_, ()>(f()))).poll_future_notify(&self.notify, 0);
        match res.unwrap() {
            Async::Ready(v) => v,
            _ => unreachable!(),
        }
    }
pub fn enter < F , R > ( & mut self , f : F ) -> R where F : FnOnce ( ) -> R , { self . notify . clear ( ) ; let res = spawn ( future :: lazy ( | | Ok :: < _ , ( ) > ( f ( ) ) ) ) . poll_future_notify ( & self . notify , 0 ) ; match res . unwrap ( ) { Async :: Ready ( v ) => v , _ => unreachable ! ( ) , } }
Run a closure from the context of the task.
Run a closure from the context of the task .
&mut self
f
F