pub struct SamplingMechanism { /* private fields */ }Expand description
Represents the mechanism that made a sampling decision.
The sampling mechanism identifies which component or rule determined whether a trace should be sampled (kept or rejected).
Implementations§
Source§impl SamplingMechanism
impl SamplingMechanism
pub const fn from_u8(value: u8) -> Self
pub fn into_u8(self) -> u8
pub fn to_priority(self, is_keep: bool) -> SamplingPriority
Sourcepub fn to_cow(self) -> Cow<'static, str>
pub fn to_cow(self) -> Cow<'static, str>
Returns the string representation of the sampling mechanism.
The format is "-N" (e.g. "-4" for manual sampling). The leading - comes from the
propagation tags RFC, which initially had a prefix component before the -; that prefix
was dropped, but the - was retained as-is for backwards compatibility with existing
existing tracers.
Trait Implementations§
Source§impl Clone for SamplingMechanism
impl Clone for SamplingMechanism
Source§fn clone(&self) -> SamplingMechanism
fn clone(&self) -> SamplingMechanism
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 SamplingMechanism
impl Debug for SamplingMechanism
Source§impl Default for SamplingMechanism
impl Default for SamplingMechanism
Source§fn default() -> SamplingMechanism
fn default() -> SamplingMechanism
Returns the “default value” for a type. Read more
Source§impl Display for SamplingMechanism
impl Display for SamplingMechanism
Source§impl FromStr for SamplingMechanism
impl FromStr for SamplingMechanism
Source§impl Hash for SamplingMechanism
impl Hash for SamplingMechanism
Source§impl PartialEq for SamplingMechanism
impl PartialEq for SamplingMechanism
Source§fn eq(&self, other: &SamplingMechanism) -> bool
fn eq(&self, other: &SamplingMechanism) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SamplingMechanism
impl Eq for SamplingMechanism
impl StructuralPartialEq for SamplingMechanism
Auto Trait Implementations§
impl Freeze for SamplingMechanism
impl RefUnwindSafe for SamplingMechanism
impl Send for SamplingMechanism
impl Sync for SamplingMechanism
impl Unpin for SamplingMechanism
impl UnsafeUnpin for SamplingMechanism
impl UnwindSafe for SamplingMechanism
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.