[−][src]Struct xi_trace::Sample
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]
name: S,
categories: C,
payload: Option<TracePayloadT>,
event_type: SampleEventType
) -> Self where
S: Into<StrCow>,
C: Into<CategoriesT>,
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]
name: S,
categories: C,
payload: Option<TracePayloadT>,
start_ns: u64,
duration_ns: u64
) -> Self where
S: Into<StrCow>,
C: Into<CategoriesT>,
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]
name: S,
categories: C,
payload: Option<TracePayloadT>
) -> Self where
S: Into<StrCow>,
C: Into<CategoriesT>,
Constructs an instantaneous sample.
Trait Implementations
impl Ord for Sample
[src]
fn cmp(&self, other: &Sample) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl Clone for Sample
[src]
fn clone(&self) -> Sample
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Sample
[src]
impl PartialEq<Sample> for Sample
[src]
fn eq(&self, other: &Sample) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialOrd<Sample> for Sample
[src]
fn partial_cmp(&self, other: &Sample) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.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) -> bool
1.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) -> bool
1.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) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Hash for Sample
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Sample
[src]
impl Serialize for Sample
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Sample
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Sync for Sample
impl Unpin for Sample
impl Send for Sample
impl RefUnwindSafe for Sample
impl UnwindSafe for Sample
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,