[][src]Struct vignette::LibunwindUnwinder

pub struct LibunwindUnwinder { /* fields omitted */ }

An Unwinder walks one stack and collects frames.

An unwinder should be created, then passed the context to unwind and finally one can retrieve the frames.

Creation should be done outside the suspend_and_resume_thread call!

Implementations

impl LibunwindUnwinder[src]

pub fn new(max_frames: usize) -> Self[src]

Creates a new Unwinder.

This sample will hold upto max_frames frames. The collection begins from the bottom-most function on the stack, so once the limit is reached, top frames are dropped.

This is NOT safe to use within suspend_and_resume_thread.

Trait Implementations

impl<'_> Unwinder<&'_ mut ucontext_t> for LibunwindUnwinder[src]

fn unwind(self, context: &mut ucontext_t) -> Result<Sample, i32>[src]

The length of the vector is the actual collected frames (<= max_frames).

This IS safe to use within suspend_and_resume_thread.

TODO: Right now if stepping fails, this whole function fails, but we may want to return the frames we have. We also probably want another state to indicate we had more frames than capacity, so users can report some kind of stats.

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