pub struct RequestSpan {
pub request_id: String,
pub parent_span_id: Option<String>,
pub operation: String,
pub start_time: Instant,
pub metadata: Vec<(String, String)>,
}Expand description
Request span for distributed tracing
Fields§
§request_id: StringUnique request ID (for correlation)
parent_span_id: Option<String>Parent span ID (if any)
operation: StringOperation name
start_time: InstantStart timestamp
metadata: Vec<(String, String)>Metadata
Implementations§
Source§impl RequestSpan
impl RequestSpan
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add metadata to span
Sourcepub fn elapsed_ms(&self) -> f64
pub fn elapsed_ms(&self) -> f64
Get elapsed milliseconds
Trait Implementations§
Source§impl Clone for RequestSpan
impl Clone for RequestSpan
Source§fn clone(&self) -> RequestSpan
fn clone(&self) -> RequestSpan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RequestSpan
impl RefUnwindSafe for RequestSpan
impl Send for RequestSpan
impl Sync for RequestSpan
impl Unpin for RequestSpan
impl UnwindSafe for RequestSpan
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