[][src]Struct vignette::Sampler

pub struct Sampler { /* fields omitted */ }

Set's up the SIGPROF handler.

Dropping this reset's the handler.

Implementations

impl Sampler[src]

pub fn new() -> Self[src]

pub fn suspend_and_resume_thread<F, T>(&self, thread: Thread, callback: F) -> T where
    F: FnOnce(&mut ucontext_t) -> T, 
[src]

Calls the callback with a suspended thread, then resumes the thread.

This function is dangerous!

  1. This function is not safe to call from multiple threads at the same time, nor is it safe to create multiple instances of Sampler and call this on two of them concurrently as it relies on global shared state.
  2. Callback must not perform any heap allocations, nor must it interact with any other shared locks that sampled threads can access.
  3. Callback should return as quickly as possible to keep the program performant.

Trait Implementations

impl Default for Sampler[src]

impl Drop for Sampler[src]

Auto Trait Implementations

impl RefUnwindSafe for Sampler

impl Send for Sampler

impl Sync for Sampler

impl Unpin for Sampler

impl UnwindSafe for Sampler

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> Erased for T

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.