#[repr(i32)]pub enum SpanFlags {
DoNotUse = 0,
TraceFlagsMask = 255,
ContextHasIsRemoteMask = 256,
ContextIsRemoteMask = 512,
}
gen-tonic-messages
and trace
only.Expand description
SpanFlags represents constants used to interpret the Span.flags field, which is protobuf ‘fixed32’ type and is to be used as bit-fields. Each non-zero value defined in this enum is a bit-mask. To extract the bit-field, for example, use an expression like:
(span.flags & SPAN_FLAGS_TRACE_FLAGS_MASK)
See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
Note that Span flags were introduced in version 1.1 of the OpenTelemetry protocol. Older Span producers do not set this field, consequently consumers should not rely on the absence of a particular flag bit to indicate the presence of a particular feature.
Variants§
DoNotUse = 0
The zero value for the enum. Should not be used for comparisons. Instead use bitwise “and” with the appropriate mask as shown above.
TraceFlagsMask = 255
Bits 0-7 are used for trace flags.
ContextHasIsRemoteMask = 256
Bits 8 and 9 are used to indicate that the parent span or link span is remote.
Bit 8 (HAS_IS_REMOTE
) indicates whether the value is known.
Bit 9 (IS_REMOTE
) indicates whether the span or link is remote.
ContextIsRemoteMask = 512
Implementations§
source§impl SpanFlags
impl SpanFlags
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl<'de> Deserialize<'de> for SpanFlags
impl<'de> Deserialize<'de> for SpanFlags
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Ord for SpanFlags
impl Ord for SpanFlags
source§impl PartialEq for SpanFlags
impl PartialEq for SpanFlags
source§impl PartialOrd for SpanFlags
impl PartialOrd for SpanFlags
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for SpanFlags
impl TryFrom<i32> for SpanFlags
§type Error = UnknownEnumValue
type Error = UnknownEnumValue
impl Copy for SpanFlags
impl Eq for SpanFlags
impl StructuralPartialEq for SpanFlags
Auto Trait Implementations§
impl Freeze for SpanFlags
impl RefUnwindSafe for SpanFlags
impl Send for SpanFlags
impl Sync for SpanFlags
impl Unpin for SpanFlags
impl UnwindSafe for SpanFlags
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key
and return true
if they are equal.source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request