Skip to main content

ProfilerBuilder

Struct ProfilerBuilder 

Source
pub struct ProfilerBuilder { /* private fields */ }
Available on crate feature dhat-compat only.
Expand description

Builder for Profiler.

Mirrors dhat::ProfilerBuilder method-for-method. Obtain via Profiler::builder.

Implementations§

Source§

impl ProfilerBuilder

Source

pub fn ad_hoc(self) -> Self

Switch the profiler to ad-hoc mode.

Source

pub fn testing(self) -> Self

Build in testing mode — suppresses the drop-time file write. Use for tests that snapshot stats directly without littering the workspace with dhat-heap.json.

Source

pub fn file_name<P: AsRef<Path>>(self, p: P) -> Self

Override the output file name. Default is dhat-heap.json (or dhat-ad-hoc.json in ad-hoc mode).

Source

pub fn trim_backtraces(self, max_frames: Option<usize>) -> Self

Maximum frames to retain per backtrace (None = walker default).

Accepted for API parity with dhat::ProfilerBuilder; silently clamped to mod-alloc’s walker cap of 8 frames. Values above 8 produce up to 8 frames; values below 8 produce that many frames in the emitted JSON.

Source

pub fn build(self) -> Profiler

Build the profiler. The returned value writes the report on drop.

Trait Implementations§

Source§

impl Debug for ProfilerBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.