pub struct TracedSpan {
pub id: String,
pub parent_id: Option<String>,
pub name: String,
pub start_ms: u64,
pub end_ms: Option<u64>,
pub duration_ms: Option<u64>,
pub attributes: HashMap<String, String>,
pub status: SpanStatus,
}Expand description
A traced span (a named section of execution)
Fields§
§id: StringUnique span ID
parent_id: Option<String>Parent span ID (if nested)
name: StringSpan name
start_ms: u64Start timestamp (ms since trace start)
end_ms: Option<u64>End timestamp (ms since trace start)
duration_ms: Option<u64>Span duration
attributes: HashMap<String, String>Span attributes
status: SpanStatusSpan status
Implementations§
Source§impl TracedSpan
impl TracedSpan
Sourcepub fn with_parent(self, parent_id: &str) -> Self
pub fn with_parent(self, parent_id: &str) -> Self
Set parent ID
Sourcepub fn add_attribute(&mut self, key: &str, value: &str)
pub fn add_attribute(&mut self, key: &str, value: &str)
Add an attribute
Sourcepub fn mark_error(&mut self, message: &str)
pub fn mark_error(&mut self, message: &str)
Mark as error
Sourcepub const fn is_complete(&self) -> bool
pub const fn is_complete(&self) -> bool
Check if span is complete
Trait Implementations§
Source§impl Clone for TracedSpan
impl Clone for TracedSpan
Source§fn clone(&self) -> TracedSpan
fn clone(&self) -> TracedSpan
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 TracedSpan
impl Debug for TracedSpan
Source§impl<'de> Deserialize<'de> for TracedSpan
impl<'de> Deserialize<'de> for TracedSpan
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TracedSpan
impl RefUnwindSafe for TracedSpan
impl Send for TracedSpan
impl Sync for TracedSpan
impl Unpin for TracedSpan
impl UnsafeUnpin for TracedSpan
impl UnwindSafe for TracedSpan
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more