pub(crate) async fn render(
        &mut self,
        buf: &mut String,
    ) -> Result<(), Error> {
        let screen_size = self.buffer.size();
        buf.clear();

        let mut colors = Color2::default();
        let mut cursor = Vec2 { x: 0, y: 0 };
        self.render_init_term(buf, colors, cursor)?;

        for &coord in self.buffer.changed.iter() {
            self.render_tile(
                buf,
                &mut colors,
                &mut cursor,
                screen_size,
                coord,
            )?;
        }

        if let Some(mut stdout) = self.data.stdout.try_lock() {
            stdout.write_and_flush(buf.as_bytes()).await?;
        }

        self.buffer.next_tick();

        Ok(())
    }
/// Renders the buffer into the screen using the referred terminal.
Renders the buffer into the screen using the referred terminal.
Renders the buffer into the screen using the referred terminal .
pub(crate) async fn render(
        &mut self,
        buf: &mut String,
    ) -> Result<(), Error> {
        let screen_size = self.buffer.size();
        buf.clear();
        let mut colors = Color2::default();
        let mut cursor = Vec2 { x: 0, y: 0 };
        self.render_init_term(buf, colors, cursor)?;
        for &coord in self.buffer.changed.iter() {
            self.render_tile(
                buf,
                &mut colors,
                &mut cursor,
                screen_size,
                coord,
            )?;
        }
        if let Some(mut stdout) = self.data.stdout.try_lock() {
            stdout.write_and_flush(buf.as_bytes()).await?;
        }
        self.buffer.next_tick();
        Ok(())
    }
pub ( crate ) async fn render ( & mut self , buf : & mut String , ) -> Result < ( ) , Error > { let screen_size = self . buffer . size ( ) ; buf . clear ( ) ; let mut colors = Color2 :: default ( ) ; let mut cursor = Vec2 { x : 0 , y : 0 } ; self . render_init_term ( buf , colors , cursor ) ? ; for & coord in self . buffer . changed . iter ( ) { self . render_tile ( buf , & mut colors , & mut cursor , screen_size , coord , ) ? ; } if let Some ( mut stdout ) = self . data . stdout . try_lock ( ) { stdout . write_and_flush ( buf . as_bytes ( ) ) . await ? ; } self . buffer . next_tick ( ) ; Ok ( ( ) ) }
Renders the buffer into the screen using the referred terminal.
Renders the buffer into the screen using the referred terminal .
&mut self
buf
&mut String
&mut self
buf
&mut String