pub fn refresh(&mut self, state: BackendState, playlist: &Playlist) -> Result<()> {
        // Move cursor back up to where we start printing
        // https://vt100.net/docs/vt100-ug/chapter3.html#CUU
        if self.lines_printed > 0 {
            self.stdout
                .write_all(format!("\x1b[{}A", self.lines_printed).as_ref())?;
        }

        let output = Self::generate_output(state, playlist)?;
        self.stdout.write_all(output.join("\n").as_ref())?;
        // -1 because last line has no newline
        self.lines_printed = output.len() - 1;

        self.stdout.flush()?;
        Ok(())
    }
/// Refreshes the output printed to the user.
Refreshes the output printed to the user.
Refreshes the output printed to the user .
pub fn refresh(&mut self, state: BackendState, playlist: &Playlist) -> Result<()> {
        // Move cursor back up to where we start printing
        // https://vt100.net/docs/vt100-ug/chapter3.html#CUU
        if self.lines_printed > 0 {
            self.stdout
                .write_all(format!("\x1b[{}A", self.lines_printed).as_ref())?;
        }
        let output = Self::generate_output(state, playlist)?;
        self.stdout.write_all(output.join("\n").as_ref())?;
        // -1 because last line has no newline
        self.lines_printed = output.len() - 1;
        self.stdout.flush()?;
        Ok(())
    }
pub fn refresh ( & mut self , state : BackendState , playlist : & Playlist ) -> Result < ( ) > { // Move cursor back up to where we start printing // https://vt100.net/docs/vt100-ug/chapter3.html#CUU if self . lines_printed > 0 { self . stdout . write_all ( format ! ( " \x1b " self lines_printed ) . as_ref ( ) ) ? ; } let output = Self :: generate_output ( state , playlist ) ? ; self . stdout . write_all ( output . join ( " \n " ) . as_ref ( ) ) ? ; // -1 because last line has no newline self . lines_printed = output . len ( ) - 1 ; self . stdout . flush ( ) ? ; Ok ( ( ) ) }
Refreshes the output printed to the user.
Refreshes the output printed to the user .
&mut self
state
BackendState
playlist
&Playlist