pub struct InstrumentedPipeline<P> { /* private fields */ }Expand description
Times the root passes of the pipeline it wraps, recording into the
PhaseMetrics the caller holds.
Wrap the standard pipeline to time the standard frame, or wrap another
decorator — .max_fps(30).instrumented(metrics) stacks a rate cap under the
timings, in either order.
let metrics = Rc::new(RefCell::new(PhaseMetrics::default()));
application.with_frame_pipeline({
let metrics = metrics.clone();
move |_window_id| Box::new(StandardImmediatePipeline.instrumented(metrics.clone()))
})Implementations§
Trait Implementations§
Source§impl<P: FramePipeline> FramePipeline for InstrumentedPipeline<P>
impl<P: FramePipeline> FramePipeline for InstrumentedPipeline<P>
Source§fn should_render(&mut self, is_dirty: bool, metrics: &WindowMetrics) -> bool
fn should_render(&mut self, is_dirty: bool, metrics: &WindowMetrics) -> bool
Whether the frame the application is about to draw should be drawn. Read more
Source§fn begin_frame(&mut self, window: &mut Window<'_>, cx: &mut App)
fn begin_frame(&mut self, window: &mut Window<'_>, cx: &mut App)
Opens the frame: samples the platform window, resets the scratch state
the frame rebuilds, and takes ownership of the invalidations this frame
owes.
Source§fn evaluate_roots(
&mut self,
window: &mut Window<'_>,
cx: &mut App,
) -> PreparedRoots
fn evaluate_roots( &mut self, window: &mut Window<'_>, cx: &mut App, ) -> PreparedRoots
Gathers the roots this frame will draw. Read more
Source§fn layout_roots(
&mut self,
window: &mut Window<'_>,
roots: &mut PreparedRoots,
cx: &mut App,
)
fn layout_roots( &mut self, window: &mut Window<'_>, roots: &mut PreparedRoots, cx: &mut App, )
Lays out and prepaints
roots, then hit tests the pointer against what
they registered. Read moreSource§fn paint_roots(
&mut self,
window: &mut Window<'_>,
roots: PreparedRoots,
cx: &mut App,
)
fn paint_roots( &mut self, window: &mut Window<'_>, roots: PreparedRoots, cx: &mut App, )
Paints
roots, in the order they stack.Source§fn finish_frame(&mut self, window: &mut Window<'_>, cx: &mut App)
fn finish_frame(&mut self, window: &mut Window<'_>, cx: &mut App)
Closes the painted frame: records the views it touched and hands the
platform the input handler the frame asked for.
Source§fn complete_frame(
&mut self,
window: &mut Window<'_>,
cx: &mut App,
) -> Option<FocusId>
fn complete_frame( &mut self, window: &mut Window<'_>, cx: &mut App, ) -> Option<FocusId>
Retires the painted frame, swaps it in, and dispatches the focus changes
the swap produced. Read more
Source§fn end_frame(
&mut self,
window: &mut Window<'_>,
cx: &mut App,
focus: Option<FocusId>,
)
fn end_frame( &mut self, window: &mut Window<'_>, cx: &mut App, focus: Option<FocusId>, )
Closes the frame out and marks it ready to present.
Auto Trait Implementations§
impl<P> !RefUnwindSafe for InstrumentedPipeline<P>
impl<P> !Send for InstrumentedPipeline<P>
impl<P> !Sync for InstrumentedPipeline<P>
impl<P> !UnwindSafe for InstrumentedPipeline<P>
impl<P> Freeze for InstrumentedPipeline<P>where
P: Freeze,
impl<P> Unpin for InstrumentedPipeline<P>where
P: Unpin,
impl<P> UnsafeUnpin for InstrumentedPipeline<P>where
P: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<P> FramePipelineExt for Pwhere
P: FramePipeline,
impl<P> FramePipelineExt for Pwhere
P: FramePipeline,
Source§fn max_fps(self, max_fps: u32) -> ThrottledPipeline<Self>
fn max_fps(self, max_fps: u32) -> ThrottledPipeline<Self>
Caps this pipeline at
max_fps frames a second. Read moreSource§fn instrumented(
self,
metrics: Rc<RefCell<PhaseMetrics>>,
) -> InstrumentedPipeline<Self>
fn instrumented( self, metrics: Rc<RefCell<PhaseMetrics>>, ) -> InstrumentedPipeline<Self>
Times this pipeline’s root passes, recording into
metrics. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more