tracing_perfetto_sdk_sys::ffi

Struct PerfettoTracingSession

Source
#[repr(C)]
pub struct PerfettoTracingSession { /* private fields */ }
Expand description

The native C++ class that is safe to be passed across the C++/Rust boundary via a unique_ptr.

Implementations§

Source§

impl PerfettoTracingSession

Source

pub fn start(self: Pin<&mut Self>)

Start collecting traces from all data sources.

Source§

impl PerfettoTracingSession

Source

pub fn stop(self: Pin<&mut Self>)

Stop collecting traces from all data sources.

Source§

impl PerfettoTracingSession

Source

pub fn flush( self: Pin<&mut Self>, timeout_ms: u32, ctx: Box<FlushCtx>, done: fn(ctx: Box<FlushCtx>, success: bool), )

Flush buffered traces.

The passed-in callback is called with true on success; false indicates that some data source didn’t ack before the timeout, or because something else went wrong (e.g. tracing system wasn’t initialized).

Source§

impl PerfettoTracingSession

Source

pub fn poll_traces( self: Pin<&mut Self>, ctx: Box<PollTracesCtx>, done: fn(ctx: Box<PollTracesCtx>, data: &[u8], has_more: bool), )

Poll for new traces, and call the provided done callback with new trace records.

Polling will only return data if an output_fd was not specified when creating the session.

If there are no more records, the callback will be called with an empty slice and has_more == true as a special case to signal EOF.

The data in the callback buffer is guaranteed to consist of complete trace records; in other words, there will not be any partial records that cross buffer boundaries.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.