pub fn wait(&mut self) -> oneshot::Receiver<()> {
        let (sender, receiver) = oneshot::channel();
        match self.state {
            TaskState::Finished => sender.send(()).unwrap(),
            _ => self.finish_hooks.push(sender),
        };
        receiver
    }
/// Create future that finishes until the task is finished
Create future that finishes until the task is finished
Create future that finishes until the task is finished
pub fn wait(&mut self) -> oneshot::Receiver<()> {
        let (sender, receiver) = oneshot::channel();
        match self.state {
            TaskState::Finished => sender.send(()).unwrap(),
            _ => self.finish_hooks.push(sender),
        };
        receiver
    }
pub fn wait ( & mut self ) -> oneshot :: Receiver < ( ) > { let ( sender , receiver ) = oneshot :: channel ( ) ; match self . state { TaskState :: Finished => sender . send ( ( ) ) . unwrap ( ) , _ => self . finish_hooks . push ( sender ) , } ; receiver }
Create future that finishes until the task is finished
Create future that finishes until the task is finished
&mut self
&mut self