Struct dhat::Profiler[][src]

pub struct Profiler;
Expand description

A type whose lifetime dictates the start and end of profiling.

Profiling starts when the first value of this type is created. Profiling stops when (a) this value is dropped or (b) a dhat assertion fails, whichever comes first. When that happens, profiling data may be written to file, depending on how the Profiler has been configured. Only one Profiler can be running at any point in time.

Implementations

Initiates allocation profiling.

Typically the first thing in main. Its result should be assigned to a variable whose lifetime ends at the end of main.

Panics

Panics if another Profiler is running.

Examples
let _profiler = dhat::Profiler::new_heap();

Initiates ad hoc profiling.

Typically the first thing in main. Its result should be assigned to a variable whose lifetime ends at the end of main.

Panics

Panics if another Profiler is running.

Examples
let _profiler = dhat::Profiler::new_ad_hoc();

Creates a new ProfilerBuilder, which defaults to heap profiling.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.