fred/trace/
disabled.rs

1#![allow(dead_code)]
2
3#[cfg(not(any(feature = "full-tracing", feature = "partial-tracing")))]
4use crate::modules::inner::ClientInner;
5#[cfg(not(any(feature = "full-tracing", feature = "partial-tracing")))]
6use crate::protocol::command::Command;
7#[cfg(not(any(feature = "full-tracing", feature = "partial-tracing")))]
8use crate::runtime::RefCount;
9#[cfg(not(any(feature = "full-tracing", feature = "partial-tracing")))]
10use redis_protocol::resp3::types::BytesFrame as Frame;
11
12/// Fake span for mocking tracing functions.
13#[cfg(not(feature = "full-tracing"))]
14pub struct Span {}
15
16#[cfg(not(feature = "full-tracing"))]
17impl Span {
18  pub fn enter(&self) {}
19
20  pub fn record<Q: ?Sized, V: ?Sized>(&self, _field: &Q, _value: &V) -> &Self {
21    self
22  }
23}
24
25#[cfg(not(any(feature = "full-tracing", feature = "partial-tracing")))]
26pub fn set_network_span(_inner: &RefCount<ClientInner>, _command: &mut Command, _flush: bool) {}
27
28#[cfg(not(any(feature = "full-tracing", feature = "partial-tracing")))]
29pub fn create_pubsub_span(_inner: &RefCount<ClientInner>, _frame: &Frame) -> Option<Span> {
30  Some(Span {})
31}
32
33#[cfg(not(any(feature = "full-tracing", feature = "partial-tracing")))]
34pub fn backpressure_event(_cmd: &Command, _: Option<u128>) {}