Struct puffin::FrameView

source ·
pub struct FrameView { /* private fields */ }
Expand description

A view of recent and slowest frames, used by GUIs.

Implementations§

source§

impl FrameView

source

pub fn is_empty(&self) -> bool

Returns true if there are no recent or slowest frames.

source

pub fn scope_collection(&self) -> &ScopeCollection

Returns the collection of scope details. This can be used to fetch more information about a specific scope.

source

pub fn add_frame(&mut self, new_frame: Arc<FrameData>)

Adds a new frame to the view.

source

pub fn latest_frame(&self) -> Option<Arc<FrameData>>

The latest fully captured frame of data.

source

pub fn latest_frames(&self, n: usize) -> Vec<Arc<FrameData>>

Returns up to n latest fully captured frames of data.

source

pub fn recent_frames(&self) -> impl Iterator<Item = &Arc<FrameData>>

Oldest first

source

pub fn slowest_frames_chronological(&self) -> Vec<Arc<FrameData>>

The slowest frames so far (or since last call to Self::clear_slowest()) in chronological order.

source

pub fn all_uniq(&self) -> Vec<Arc<FrameData>>

All frames sorted chronologically.

source

pub fn clear_slowest(&mut self)

Clean history of the slowest frames.

source

pub fn max_recent(&self) -> usize

How many frames of recent history to store.

source

pub fn set_max_recent(&mut self, max_recent: usize)

How many frames of recent history to store.

source

pub fn max_slow(&self) -> usize

How many slow “spike” frames to store.

source

pub fn set_max_slow(&mut self, max_slow: usize)

How many slow “spike” frames to store.

source

pub fn pack_frames(&self) -> bool

Returns if frames are packed (compressed).

source

pub fn set_pack_frames(&mut self, pack_frames: bool)

Sets wether frames should be packed (compressed). Packing frames will increase CPU time and decrease memory usage.

source

pub fn write(&self, write: &mut impl Write) -> Result<()>

Export profile data as a .puffin file/stream.

source

pub fn read(read: &mut impl Read) -> Result<Self>

Import profile data from a .puffin file/stream.

Trait Implementations§

source§

impl Clone for FrameView

source§

fn clone(&self) -> FrameView

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for FrameView

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.