fn render_history<B: Backend>(f: &mut Frame<'_, B>, app: &mut TuiApp, rect: Rect) {
    let target_hop = app.table_state.selected().map_or_else(
        || app.tracer_data().target_hop(),
        |s| &app.tracer_data().hops()[s],
    );
    let data = target_hop
        .samples()
        .iter()
        .take(rect.width as usize)
        .map(|s| (s.as_secs_f64() * 1000_f64) as u64)
        .collect::<Vec<_>>();
    let history = Sparkline::default()
        .block(
            Block::default()
                .title(format!("Samples #{}", target_hop.ttl()))
                .borders(Borders::ALL)
                .border_type(BorderType::Rounded),
        )
        .data(&data)
        .style(Style::default().fg(Color::Yellow));
    f.render_widget(history, rect);
}
/// Render the ping history for the final hop which is typically the target.
Render the ping history for the final hop which is typically the target.
Render the ping history for the final hop which is typically the target .
fn render_history<B: Backend>(f: &mut Frame<'_, B>, app: &mut TuiApp, rect: Rect) {
    let target_hop = app.table_state.selected().map_or_else(
        || app.tracer_data().target_hop(),
        |s| &app.tracer_data().hops()[s],
    );
    let data = target_hop
        .samples()
        .iter()
        .take(rect.width as usize)
        .map(|s| (s.as_secs_f64() * 1000_f64) as u64)
        .collect::<Vec<_>>();
    let history = Sparkline::default()
        .block(
            Block::default()
                .title(format!("Samples #{}", target_hop.ttl()))
                .borders(Borders::ALL)
                .border_type(BorderType::Rounded),
        )
        .data(&data)
        .style(Style::default().fg(Color::Yellow));
    f.render_widget(history, rect);
}
fn render_history < B : Backend > ( f : & mut Frame < ' _ , B > , app : & mut TuiApp , rect : Rect ) { let target_hop = app . table_state . selected ( ) . map_or_else ( | | app . tracer_data ( ) . target_hop ( ) , | s | & app . tracer_data ( ) . hops ( ) [ s ] , ) ; let data = target_hop . samples ( ) . iter ( ) . take ( rect . width as usize ) . map ( | s | ( s . as_secs_f64 ( ) * 1000_f64 ) as u64 ) . collect :: < Vec < _ > > ( ) ; let history = Sparkline :: default ( ) . block ( Block :: default ( ) . title ( format ! ( " " target_hop ttl ( ) ) ) . borders ( Borders :: ALL ) . border_type ( BorderType :: Rounded ) , ) . data ( & data ) . style ( Style :: default ( ) . fg ( Color :: Yellow ) ) ; f . render_widget ( history , rect ) ; }
Render the ping history for the final hop which is typically the target.
Render the ping history for the final hop which is typically the target .
f
&mut Frame<'_, B>
app
&mut TuiApp
rect
Rect