[][src]Struct puffin::ThreadProfiler

pub struct ThreadProfiler { /* fields omitted */ }

Collects profiling data for one thread

Implementations

impl ThreadProfiler[src]

pub fn initialize(
    now_ns: fn() -> NanoSecond,
    reporter: fn(_: ThreadInfo, _: Stream)
)
[src]

Explicit initialize with custom callbacks.

If not called, each thread will use the default nanosecond source and report scopes to the global profiler.

For instance, when compiling for WASM the default timing function (puffin::now_ns) won't work, so you'll want to call puffin::ThreadProfiler::initialize(my_timing_function, puffin::global_reporter);.

pub fn begin_scope(&mut self, id: &str, location: &str, data: &str) -> usize[src]

Returns position where to write scope size once the scope is closed.

pub fn end_scope(&mut self, start_offset: usize)[src]

pub fn call<R>(f: impl Fn(&mut Self) -> R) -> R[src]

Do something with the thread local ThreadProfiler

Trait Implementations

impl Default for ThreadProfiler[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.