pub struct TraceContext {
pub trace_id: String,
pub span_id: String,
pub parent_span_id: Option<String>,
pub originating_core_id: CoreId,
pub current_core_id: CoreId,
pub tenant_id: TenantId,
pub command_id: Option<String>,
}Expand description
Correlation context propagated across distributed Runtime boundaries.
Fields§
§trace_id: StringEnd-to-end trace identity.
span_id: StringCurrent span identity.
parent_span_id: Option<String>Parent span identity, when this is a child span.
originating_core_id: CoreIdCore that originated the trace.
current_core_id: CoreIdCore currently handling the operation.
tenant_id: TenantIdTenant isolation boundary.
command_id: Option<String>Optional command identity associated with the trace.
Implementations§
Source§impl TraceContext
impl TraceContext
Sourcepub fn new(
trace_id: impl Into<String>,
span_id: impl Into<String>,
originating_core_id: CoreId,
current_core_id: CoreId,
tenant_id: TenantId,
) -> Result<TraceContext, RuntimeError>
pub fn new( trace_id: impl Into<String>, span_id: impl Into<String>, originating_core_id: CoreId, current_core_id: CoreId, tenant_id: TenantId, ) -> Result<TraceContext, RuntimeError>
Creates and validates a root trace context.
Sourcepub fn with_command_id(
self,
command_id: impl Into<String>,
) -> Result<TraceContext, RuntimeError>
pub fn with_command_id( self, command_id: impl Into<String>, ) -> Result<TraceContext, RuntimeError>
Associates a validated command identity with this context.
Sourcepub fn child_span(
&self,
span_id: impl Into<String>,
current_core_id: CoreId,
) -> Result<TraceContext, RuntimeError>
pub fn child_span( &self, span_id: impl Into<String>, current_core_id: CoreId, ) -> Result<TraceContext, RuntimeError>
Creates a child span for another Core while preserving correlation.
Trait Implementations§
Source§impl Clone for TraceContext
impl Clone for TraceContext
Source§fn clone(&self) -> TraceContext
fn clone(&self) -> TraceContext
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 TraceContext
impl Debug for TraceContext
Source§impl<'de> Deserialize<'de> for TraceContext
impl<'de> Deserialize<'de> for TraceContext
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TraceContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TraceContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TraceContext
Source§impl PartialEq for TraceContext
impl PartialEq for TraceContext
Source§impl Serialize for TraceContext
impl Serialize for TraceContext
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for TraceContext
Auto Trait Implementations§
impl Freeze for TraceContext
impl RefUnwindSafe for TraceContext
impl Send for TraceContext
impl Sync for TraceContext
impl Unpin for TraceContext
impl UnsafeUnpin for TraceContext
impl UnwindSafe for TraceContext
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