#[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 PartialOrd for SpanFlags
impl PartialOrd for SpanFlags
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§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