1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use core::fmt;

use tracing::dispatcher;

pub mod body;
pub mod bridge;

#[cfg(feature = "client")]
pub mod client;

#[cfg(feature = "discovery")]
pub mod discovery;

pub mod happy_eyeballs;

#[cfg(feature = "client")]
mod lazy;

#[cfg(feature = "pidfile")]
pub mod pidfile;

#[cfg(feature = "server")]
mod rewind;

#[cfg(feature = "server")]
pub mod server;
pub mod stream;

#[allow(unused)]
pub(crate) struct DebugLiteral<T: fmt::Display>(T);

impl<T: fmt::Display> fmt::Debug for DebugLiteral<T> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.0)
    }
}

#[allow(unused)]
pub(crate) fn polled_span(span: &tracing::Span) {
    dispatcher::get_default(|dispatch| {
        let id = span.id().expect("Missing ID; this is a bug");
        if let Some(current) = dispatch.current_span().id() {
            dispatch.record_follows_from(&id, current)
        }
    });
}

pub(crate) mod private {

    #[allow(unused)]
    pub trait Sealed {}
}