pub struct SamplingPriority { /* private fields */ }Expand description
Represents the sampling priority of a trace.
Positive values indicate the trace should be kept, while zero or negative
values indicate rejection. Use the constants in the priority module
for standard priority values.
Implementations§
Source§impl SamplingPriority
impl SamplingPriority
pub const fn from_i8(value: i8) -> Self
pub fn into_i8(self) -> i8
Sourcepub fn is_keep(&self) -> bool
pub fn is_keep(&self) -> bool
Returns whether this sampling priority indicates the trace should be kept.
§Returns
true if the priority value is positive (indicating the trace should be kept),
false otherwise (indicating the trace should be dropped).
§Examples
use libdd_sampling::priority;
assert!(priority::AUTO_KEEP.is_keep());
assert!(priority::USER_KEEP.is_keep());
assert!(!priority::AUTO_REJECT.is_keep());
assert!(!priority::USER_REJECT.is_keep());Trait Implementations§
Source§impl Clone for SamplingPriority
impl Clone for SamplingPriority
Source§fn clone(&self) -> SamplingPriority
fn clone(&self) -> SamplingPriority
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SamplingPriority
impl Debug for SamplingPriority
Source§impl Display for SamplingPriority
impl Display for SamplingPriority
Source§impl FromStr for SamplingPriority
impl FromStr for SamplingPriority
Source§impl Hash for SamplingPriority
impl Hash for SamplingPriority
Source§impl PartialEq for SamplingPriority
impl PartialEq for SamplingPriority
Source§fn eq(&self, other: &SamplingPriority) -> bool
fn eq(&self, other: &SamplingPriority) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SamplingPriority
impl Eq for SamplingPriority
impl StructuralPartialEq for SamplingPriority
Auto Trait Implementations§
impl Freeze for SamplingPriority
impl RefUnwindSafe for SamplingPriority
impl Send for SamplingPriority
impl Sync for SamplingPriority
impl Unpin for SamplingPriority
impl UnsafeUnpin for SamplingPriority
impl UnwindSafe for SamplingPriority
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.