pub struct TraceQuery<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> TraceQuery<'a>
impl<'a> TraceQuery<'a>
Sourcepub fn from_buffer(buffer: &'a TraceBuffer) -> Self
pub fn from_buffer(buffer: &'a TraceBuffer) -> Self
Create a query interface from a trace buffer.
Sourcepub const fn from_frames(frames: Vec<&'a FrameRecord>) -> Self
pub const fn from_frames(frames: Vec<&'a FrameRecord>) -> Self
Create a query interface from a slice of frame records.
Sourcepub fn find_frames(&self, predicate: impl Fn(&FrameRecord) -> bool) -> Vec<u64>
pub fn find_frames(&self, predicate: impl Fn(&FrameRecord) -> bool) -> Vec<u64>
Find all frames matching a predicate.
Sourcepub fn find_frames_with_context(
&self,
predicate: impl Fn(&FrameRecord) -> bool,
context_frames: usize,
) -> Vec<QueryResult>
pub fn find_frames_with_context( &self, predicate: impl Fn(&FrameRecord) -> bool, context_frames: usize, ) -> Vec<QueryResult>
Find frames with context (frames before and after).
Sourcepub fn count_frames(&self, predicate: impl Fn(&FrameRecord) -> bool) -> usize
pub fn count_frames(&self, predicate: impl Fn(&FrameRecord) -> bool) -> usize
Count frames matching a predicate.
Sourcepub fn frames_with_inputs(&self) -> Vec<u64>
pub fn frames_with_inputs(&self) -> Vec<u64>
Find frames with any input events.
Sourcepub fn frames_with_input_type(
&self,
event_type_matcher: impl Fn(&InputEventType) -> bool,
) -> Vec<u64>
pub fn frames_with_input_type( &self, event_type_matcher: impl Fn(&InputEventType) -> bool, ) -> Vec<u64>
Find frames with specific input event type.
Sourcepub fn get_frame(&self, frame_number: u64) -> Option<&FrameRecord>
pub fn get_frame(&self, frame_number: u64) -> Option<&FrameRecord>
Get frame at specific frame number.
Sourcepub fn get_frame_range(&self, start: u64, end: u64) -> Vec<&FrameRecord>
pub fn get_frame_range(&self, start: u64, end: u64) -> Vec<&FrameRecord>
Get frame range (inclusive).
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Get total frame count.
Sourcepub fn first_frame(&self) -> Option<u64>
pub fn first_frame(&self) -> Option<u64>
Get first frame number (if any).
Sourcepub fn last_frame(&self) -> Option<u64>
pub fn last_frame(&self) -> Option<u64>
Get last frame number (if any).
Sourcepub fn input_density(&self) -> f64
pub fn input_density(&self) -> f64
Calculate input density (inputs per frame).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for TraceQuery<'a>
impl<'a> RefUnwindSafe for TraceQuery<'a>
impl<'a> Send for TraceQuery<'a>
impl<'a> Sync for TraceQuery<'a>
impl<'a> Unpin for TraceQuery<'a>
impl<'a> UnwindSafe for TraceQuery<'a>
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<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