pub struct SpanContext {
pub process_id: ProcessId,
pub span_id: SpanId,
}Fields§
§process_id: ProcessIdThe id of the process this span belongs to.
span_id: SpanIdThe unique id of this span.
Implementations§
Source§impl SpanContext
impl SpanContext
Sourcepub fn new(process_id: ProcessId, span_id: SpanId) -> SpanContext
pub fn new(process_id: ProcessId, span_id: SpanId) -> SpanContext
Sourcepub fn current() -> Option<SpanContext>
pub fn current() -> Option<SpanContext>
Creates a SpanContext from the current local parent span. If there is no
local parent span, this function will return None.
§Examples
use veecle_telemetry::*;
let span = Span::new("root", &[]);
let _guard = span.entered();
let span_context = SpanContext::current();
assert!(span_context.is_some());Trait Implementations§
Source§impl Clone for SpanContext
impl Clone for SpanContext
Source§fn clone(&self) -> SpanContext
fn clone(&self) -> SpanContext
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 moreSource§impl Debug for SpanContext
impl Debug for SpanContext
Source§impl<'de> Deserialize<'de> for SpanContext
impl<'de> Deserialize<'de> for SpanContext
Source§fn deserialize<D>(
deserializer: D,
) -> Result<SpanContext, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SpanContext, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SpanContext
impl Display for SpanContext
Source§impl FromStr for SpanContext
impl FromStr for SpanContext
Source§type Err = ParseSpanContextError
type Err = ParseSpanContextError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<SpanContext, <SpanContext as FromStr>::Err>
fn from_str(s: &str) -> Result<SpanContext, <SpanContext as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for SpanContext
impl Hash for SpanContext
Source§impl Ord for SpanContext
impl Ord for SpanContext
Source§fn cmp(&self, other: &SpanContext) -> Ordering
fn cmp(&self, other: &SpanContext) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SpanContext
impl PartialEq for SpanContext
Source§impl PartialOrd for SpanContext
impl PartialOrd for SpanContext
Source§impl Serialize for SpanContext
impl Serialize for SpanContext
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 Copy for SpanContext
impl Eq for SpanContext
impl StructuralPartialEq for SpanContext
Auto Trait Implementations§
impl Freeze for SpanContext
impl RefUnwindSafe for SpanContext
impl Send for SpanContext
impl Sync for SpanContext
impl Unpin for SpanContext
impl UnwindSafe for SpanContext
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