pub trait TraceTrait: PrivateTraceTrait + Sized {
    // Required methods
    fn trace_handle(&self) -> TraceHandle;
    fn events_handled(&self) -> usize;

    // Provided methods
    fn process(&mut self) -> Result<(), TraceError> { ... }
    fn process_from_handle(handle: TraceHandle) -> Result<(), TraceError> { ... }
    fn stop(self) -> Result<(), TraceError> { ... }
}
Expand description

Trait for common methods to user, kernel and file traces

Required Methods§

Provided Methods§

source

fn process(&mut self) -> Result<(), TraceError>

This is blocking and starts triggerring the callbacks.

Because this call is blocking, you probably want to call this from a background thread.
See TraceBuilder::start for alternative and more convenient ways to start a trace.

source

fn process_from_handle(handle: TraceHandle) -> Result<(), TraceError>

Process a trace given its handle.

See TraceBuilder::start for alternative and more convenient ways to start a trace.

source

fn stop(self) -> Result<(), TraceError>

Stops the trace

This consumes the trace, that can no longer be used afterwards. The same result is achieved by dropping Self

Implementors§