aingle_observability/open/
off.rs

1use super::*;
2#[derive(Debug, Clone, Default)]
3pub struct Context;
4
5#[derive(Debug, Clone)]
6pub struct WireContext {
7    span_context: WireSpanContext,
8    links: Option<WireLinks>,
9}
10
11#[derive(Debug, Clone, derive_more::From, derive_more::Into)]
12pub struct WireLinks(pub Vec<WireLink>);
13
14#[derive(Debug, Clone)]
15pub struct WireLink;
16
17#[derive(Debug, Clone)]
18pub struct WireSpanContext;
19
20impl OpenSpanExt for tracing::Span {
21    fn get_current_context() -> Context {
22        Context
23    }
24    fn get_context(&self) -> Context {
25        Context
26    }
27
28    fn get_current_bytes() -> Vec<u8> {
29        Vec::with_capacity(0)
30    }
31
32    fn set_context(&self, _: Context) {}
33
34    fn set_current_context(_: Context) {}
35    fn set_current_bytes(_bytes: Vec<u8>) {}
36
37    fn display_context(&self) -> String {
38        String::with_capacity(0)
39    }
40}
41
42impl std::fmt::Display for Context {
43    fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
44        Ok(())
45    }
46}
47pub struct Config;