[][src]Struct xi_trace::Sample

pub struct Sample {
    pub name: StrCow,
    pub categories: Option<CategoriesT>,
    pub timestamp_us: u64,
    pub event_type: SampleEventType,
    pub duration_us: Option<u64>,
    pub pid: u64,
    pub tid: u64,
    pub thread_name: Option<StrCow>,
    pub args: Option<SampleArgs>,
}

Stores the relevant data about a sample for later serialization. The payload associated with any sample is by default a string but may be configured via the json_payload feature (there is an associated performance hit across the board for turning it on).

Fields

name: StrCow

The name of the event to be shown.

categories: Option<CategoriesT>

List of categories the event applies to.

timestamp_us: u64

When was the sample started.

event_type: SampleEventType

What kind of sample this is.

duration_us: Option<u64>pid: u64

The process the sample was captured in.

tid: u64

The thread the sample was captured on. Omitted for Metadata events that want to set the process name (if provided then sets the thread name).

thread_name: Option<StrCow>args: Option<SampleArgs>

Methods

impl Sample[src]

pub fn new_duration_marker<S, C>(
    name: S,
    categories: C,
    payload: Option<TracePayloadT>,
    event_type: SampleEventType
) -> Self where
    S: Into<StrCow>,
    C: Into<CategoriesT>, 
[src]

Constructs a Begin or End sample. Should not be used directly. Instead should be constructed via SampleGuard.

pub fn new_duration<S, C>(
    name: S,
    categories: C,
    payload: Option<TracePayloadT>,
    start_ns: u64,
    duration_ns: u64
) -> Self where
    S: Into<StrCow>,
    C: Into<CategoriesT>, 
[src]

Constructs a Duration sample. For use via xi_trace::closure.

pub fn new_instant<S, C>(
    name: S,
    categories: C,
    payload: Option<TracePayloadT>
) -> Self where
    S: Into<StrCow>,
    C: Into<CategoriesT>, 
[src]

Constructs an instantaneous sample.

Trait Implementations

impl PartialOrd<Sample> for Sample[src]

#[must_use] fn lt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use] fn le(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use] fn gt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use] fn ge(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Eq for Sample[src]

impl PartialEq<Sample> for Sample[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Ord for Sample[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Clone for Sample[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Hash for Sample[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Sample[src]

impl Serialize for Sample[src]

impl<'de> Deserialize<'de> for Sample[src]

Auto Trait Implementations

impl Sync for Sample

impl Send for Sample

impl Unpin for Sample

impl RefUnwindSafe for Sample

impl UnwindSafe for Sample

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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.

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]