pub struct Span {
pub trace_id: String,
pub span_id: String,
pub parent_id: Option<String>,
pub operation_name: String,
pub service_name: String,
pub start_time: i64,
pub end_time: Option<i64>,
pub tags: HashMap<String, String>,
pub logs: Vec<SpanLog>,
}Fields§
§trace_id: String§span_id: String§parent_id: Option<String>§operation_name: String§service_name: String§start_time: i64§end_time: Option<i64>§logs: Vec<SpanLog>Implementations§
Source§impl Span
impl Span
pub fn new( trace_id: impl Into<String>, span_id: impl Into<String>, operation_name: impl Into<String>, ) -> Self
pub fn with_parent(self, parent_id: impl Into<String>) -> Self
pub fn with_service(self, service_name: impl Into<String>) -> Self
pub fn with_tag(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn finish(&mut self)
pub fn duration(&self) -> Option<i64>
pub fn add_log(&mut self, message: impl Into<String>)
pub fn trace_id(&self) -> &str
pub fn span_id(&self) -> &str
pub fn parent_id(&self) -> Option<&str>
pub fn operation_name(&self) -> &str
pub fn service_name(&self) -> &str
pub fn logs(&self) -> &[SpanLog]
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Span
impl<'de> Deserialize<'de> for Span
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 Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
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