Struct SpanContext
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§
§impl SpanContext
impl SpanContext
pub fn new(process_id: ProcessId, span_id: SpanId) -> SpanContext
pub fn new(process_id: ProcessId, span_id: SpanId) -> SpanContext
pub 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§
§impl Clone for SpanContext
impl Clone for SpanContext
§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 more§impl Debug for SpanContext
impl Debug for SpanContext
§impl<'de> Deserialize<'de> for SpanContext
impl<'de> Deserialize<'de> for SpanContext
§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
§impl Display for SpanContext
impl Display for SpanContext
§impl FromStr for SpanContext
impl FromStr for SpanContext
§type Err = ParseSpanContextError
type Err = ParseSpanContextError
The associated error which can be returned from parsing.
§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 more§impl Hash for SpanContext
impl Hash for SpanContext
§impl Ord for SpanContext
impl Ord for SpanContext
§impl PartialEq for SpanContext
impl PartialEq for SpanContext
§impl PartialOrd for SpanContext
impl PartialOrd for SpanContext
§impl Serialize for SpanContext
impl Serialize for SpanContext
§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