/// execute all the pending tasks until there's none remaining or
///  the allowed lifetime is expired (usually when the user typed a new key)
execute all the pending tasks until there's none remaining or
the allowed lifetime is expired (usually when the user typed a new key)
execute all the pending tasks until there ' s none remaining or the allowed lifetime is expired ( usually when the user typed a new key )
fn do_pending_tasks(
        &mut self,
        cmd: &Command,
        screen: &mut Screen,
        con: &AppContext,
        tl: TaskLifetime,
    ) -> io::Result<()> {
        let has_task = self.state().has_pending_tasks();
        if has_task {
            loop {
                self.mut_state().display(screen, con)?;
                self.state().write_status(screen, &cmd, con)?;
                screen.write_spinner(true)?;
                if tl.is_expired() {
                    break;
                }
                self.mut_state().do_pending_task(screen, &tl);
                if !self.state().has_pending_tasks() {
                    break;
                }
            }
            screen.write_spinner(false)?;
            self.mut_state().display(screen, con)?;
            self.mut_state().write_status(screen, &cmd, con)?;
        }
        Ok(())
    }
fn do_pending_tasks ( & mut self , cmd : & Command , screen : & mut Screen , con : & AppContext , tl : TaskLifetime , ) -> io :: Result < ( ) > { let has_task = self . state ( ) . has_pending_tasks ( ) ; if has_task { loop { self . mut_state ( ) . display ( screen , con ) ? ; self . state ( ) . write_status ( screen , & cmd , con ) ? ; screen . write_spinner ( true ) ? ; if tl . is_expired ( ) { break ; } self . mut_state ( ) . do_pending_task ( screen , & tl ) ; if ! self . state ( ) . has_pending_tasks ( ) { break ; } } screen . write_spinner ( false ) ? ; self . mut_state ( ) . display ( screen , con ) ? ; self . mut_state ( ) . write_status ( screen , & cmd , con ) ? ; } Ok ( ( ) ) }
execute all the pending tasks until there's none remaining or
the allowed lifetime is expired (usually when the user typed a new key)
execute all the pending tasks until there ' s none remaining or the allowed lifetime is expired ( usually when the user typed a new key )
&mut self
cmd
&Command
screen
&mut Screen
con
&AppContext
tl
TaskLifetime