Skip to main content

PerfRenderer

Trait PerfRenderer 

Source
pub trait PerfRenderer {
    // Required method
    fn render(
        &mut self,
        stats: &FrameStats<FRAME_HISTORY>,
        backend: &str,
        area: Rect,
        surface: &mut Surface<'_>,
    );
}
Expand description

Draws a super::PerfOverlayApp’s stats into a rectangular area of a Surface.

Implemented for any FnMut(&FrameStats<FRAME_HISTORY>, &str, Rect, &mut Surface<'_>) (pass such a closure to PerfOverlayApp::with_closure; see its docs for why that constructor exists instead of just accepting impl PerfRenderer everywhere), so a plain closure is enough for a custom overlay; see the module docs for composing one out of this crate’s widgets. DefaultPerfRenderer is the built-in implementation, used by PerfOverlayApp::new.

Required Methods§

Source

fn render( &mut self, stats: &FrameStats<FRAME_HISTORY>, backend: &str, area: Rect, surface: &mut Surface<'_>, )

Draws stats (and the caller-supplied backend label) into area, via surface scoped to it.

Implementors§

Source§

impl PerfRenderer for DefaultPerfRenderer

Source§

impl<F> PerfRenderer for F
where F: FnMut(&FrameStats<FRAME_HISTORY>, &str, Rect, &mut Surface<'_>),