1#![cfg_attr(not(feature = "std"), no_std)]
4#![cfg_attr(not(test), deny(clippy::panic))]
5#![cfg_attr(not(test), deny(clippy::unwrap_used))]
6#![cfg_attr(not(test), deny(clippy::expect_used))]
7#![cfg_attr(not(test), deny(clippy::todo))]
8#![cfg_attr(not(test), deny(clippy::unimplemented))]
9
10#[cfg(feature = "alloc")]
11extern crate alloc;
12
13#[cfg(feature = "std")]
14pub mod azure_app_services;
15#[cfg(all(feature = "std", not(target_arch = "wasm32")))]
16pub mod cc_utils;
17#[cfg(all(feature = "std", not(target_arch = "wasm32")))]
18pub mod connector;
19#[cfg(feature = "reqwest")]
20#[cfg(feature = "http-client")]
21pub mod dump_server;
22#[cfg(feature = "std")]
23mod endpoint;
24#[cfg(feature = "std")]
25pub mod entity_id;
26#[cfg(feature = "std")]
27mod lock_ext;
28#[cfg(feature = "std")]
29pub mod machine_id;
30#[cfg(feature = "std")]
31pub mod mutable_metadata;
32#[cfg(feature = "std")]
33pub mod regex_engine;
34#[cfg(feature = "std")]
35#[macro_use]
36pub mod cstr;
37#[cfg(feature = "bench-utils")]
38pub mod bench_utils;
39#[cfg(feature = "std")]
40pub mod config;
41#[cfg(feature = "std")]
42pub mod error;
43#[cfg(feature = "http-client")]
44pub mod http_common;
45#[cfg(feature = "std")]
46pub mod multipart;
47#[cfg(all(feature = "std", not(target_arch = "wasm32")))]
48pub mod rate_limiter;
49pub mod tag;
50#[cfg(all(feature = "std", any(test, feature = "test-utils")))]
51pub mod test_utils;
52#[cfg(all(feature = "std", not(target_arch = "wasm32"), not(target_os = "aix")))]
53pub mod threading;
54#[cfg(all(feature = "std", not(target_arch = "wasm32")))]
55pub mod timeout;
56#[cfg(feature = "std")]
57pub mod unix_utils;
58
59pub trait ResultInfallibleExt<T>: sealed::Sealed {
75 fn unwrap_infallible(self) -> T;
76}
77
78impl<T> ResultInfallibleExt<T> for Result<T, core::convert::Infallible> {
79 #[inline(always)]
80 fn unwrap_infallible(self) -> T {
81 match self {
82 Ok(value) => value,
83 Err(never) => match never {},
84 }
85 }
86}
87
88mod sealed {
89 pub trait Sealed {}
90 impl<T> Sealed for Result<T, core::convert::Infallible> {}
91}
92
93#[cfg(feature = "std")]
94pub mod header {
95 #![allow(clippy::declare_interior_mutable_const)]
96 use http::{HeaderValue, header::HeaderName};
97
98 pub const APPLICATION_MSGPACK_STR: &str = "application/msgpack";
99 pub const APPLICATION_PROTOBUF_STR: &str = "application/x-protobuf";
100
101 pub const DATADOG_CONTAINER_ID: HeaderName = HeaderName::from_static("datadog-container-id");
102 pub const DATADOG_ENTITY_ID: HeaderName = HeaderName::from_static("datadog-entity-id");
103 pub const DATADOG_EXTERNAL_ENV: HeaderName = HeaderName::from_static("datadog-external-env");
104 pub const DATADOG_TRACE_COUNT: HeaderName = HeaderName::from_static("x-datadog-trace-count");
105 pub const DATADOG_SEND_REAL_HTTP_STATUS: HeaderName =
109 HeaderName::from_static("datadog-send-real-http-status");
110 pub const DATADOG_API_KEY: HeaderName = HeaderName::from_static("dd-api-key");
111 pub const APPLICATION_JSON: HeaderValue = HeaderValue::from_static("application/json");
112 pub const APPLICATION_MSGPACK: HeaderValue = HeaderValue::from_static(APPLICATION_MSGPACK_STR);
113 pub const APPLICATION_PROTOBUF: HeaderValue =
114 HeaderValue::from_static(APPLICATION_PROTOBUF_STR);
115 pub const X_DATADOG_TEST_SESSION_TOKEN: HeaderName =
116 HeaderName::from_static("x-datadog-test-session-token");
117}
118
119#[cfg(all(not(target_arch = "wasm32"), feature = "http-client"))]
120pub type HttpClient = http_common::GenericHttpClient<connector::Connector>;
121#[cfg(all(not(target_arch = "wasm32"), feature = "http-client"))]
122pub type HttpResponse = http_common::HttpResponse;
123#[cfg(feature = "std")]
124pub type HttpRequestBuilder = http::request::Builder;
125#[cfg(all(not(target_arch = "wasm32"), feature = "http-client"))]
126pub trait Connect:
127 hyper_util::client::legacy::connect::Connect + Clone + Send + Sync + 'static
128{
129}
130#[cfg(all(not(target_arch = "wasm32"), feature = "http-client"))]
131impl<C: hyper_util::client::legacy::connect::Connect + Clone + Send + Sync + 'static> Connect
132 for C
133{
134}
135
136#[cfg(feature = "std")]
137pub use {
138 endpoint::{Endpoint, decode_uri_path_in_authority, parse_uri},
139 lock_ext::{MutexExt, RwLockExt},
140};
141
142#[cfg(feature = "alloc")]
144pub use const_format;