pub(crate) async fn renderer(shared: &Shared) -> Result<(), Error> {
    let mut interval = time::interval(shared.screen().frame_time);
    let mut buf = String::new();

    loop {
        {
            let _guard = shared.service_guard().await?;
            let mut screen = shared.screen().lock().await;
            screen.render(&mut buf).await?;
        }

        tokio::select! {
            _ = interval.tick() => (),
            _ = shared.screen().subscribe() => break,
        };
    }

    Ok(())
}
/// The renderer loop. Should be called only when setting up a terminal handler.
/// Exits on error or when notified that it should exit.
The renderer loop. Should be called only when setting up a terminal handler.
Exits on error or when notified that it should exit.
The renderer loop . Should be called only when setting up a terminal handler . Exits on error or when notified that it should exit .
pub(crate) async fn renderer(shared: &Shared) -> Result<(), Error> {
    let mut interval = time::interval(shared.screen().frame_time);
    let mut buf = String::new();
    loop {
        {
            let _guard = shared.service_guard().await?;
            let mut screen = shared.screen().lock().await;
            screen.render(&mut buf).await?;
        }
        tokio::select! {
            _ = interval.tick() => (),
            _ = shared.screen().subscribe() => break,
        };
    }
    Ok(())
}
pub ( crate ) async fn renderer ( shared : & Shared ) -> Result < ( ) , Error > { let mut interval = time :: interval ( shared . screen ( ) . frame_time ) ; let mut buf = String :: new ( ) ; loop { { let _guard = shared . service_guard ( ) . await ? ; let mut screen = shared . screen ( ) . lock ( ) . await ; screen . render ( & mut buf ) . await ? ; } tokio :: select ! { interval tick ( ) ( ) shared screen ( ) subscribe ( ) break } ; } Ok ( ( ) ) }
The renderer loop.
The renderer loop .
shared
&Shared
shared
&Shared