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(feature = "std")]
16pub mod config;
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")]
27pub mod error;
28#[cfg(feature = "http-client")]
29pub mod http_common;
30#[cfg(feature = "std")]
31mod lock_ext;
32#[cfg(feature = "std")]
33pub mod machine_id;
34#[cfg(feature = "std")]
35pub mod multipart;
36#[cfg(feature = "std")]
37pub mod mutable_metadata;
38#[cfg(feature = "std")]
39pub mod regex_engine;
40pub mod tag;
41#[cfg(all(feature = "std", not(target_arch = "wasm32"), not(target_os = "aix")))]
42pub mod threading;
43#[cfg(all(feature = "std", not(target_arch = "wasm32")))]
44pub mod timeout;
45#[cfg(feature = "std")]
46pub mod unix_utils;
47
48pub trait ResultInfallibleExt<T>: sealed::Sealed {
64 fn unwrap_infallible(self) -> T;
65}
66
67impl<T> ResultInfallibleExt<T> for Result<T, core::convert::Infallible> {
68 #[inline(always)]
69 fn unwrap_infallible(self) -> T {
70 match self {
71 Ok(value) => value,
72 Err(never) => match never {},
73 }
74 }
75}
76
77mod sealed {
78 pub trait Sealed {}
79 impl<T> Sealed for Result<T, core::convert::Infallible> {}
80}
81
82#[cfg(feature = "std")]
83pub mod header {
84 #![allow(clippy::declare_interior_mutable_const)]
85 use http::{HeaderValue, header::HeaderName};
86
87 pub const APPLICATION_MSGPACK_STR: &str = "application/msgpack";
88 pub const APPLICATION_PROTOBUF_STR: &str = "application/x-protobuf";
89
90 pub const DATADOG_CONTAINER_ID: HeaderName = HeaderName::from_static("datadog-container-id");
91 pub const DATADOG_ENTITY_ID: HeaderName = HeaderName::from_static("datadog-entity-id");
92 pub const DATADOG_EXTERNAL_ENV: HeaderName = HeaderName::from_static("datadog-external-env");
93 pub const DATADOG_TRACE_COUNT: HeaderName = HeaderName::from_static("x-datadog-trace-count");
94 pub const DATADOG_SEND_REAL_HTTP_STATUS: HeaderName =
98 HeaderName::from_static("datadog-send-real-http-status");
99 pub const DATADOG_API_KEY: HeaderName = HeaderName::from_static("dd-api-key");
100 pub const APPLICATION_JSON: HeaderValue = HeaderValue::from_static("application/json");
101 pub const APPLICATION_MSGPACK: HeaderValue = HeaderValue::from_static(APPLICATION_MSGPACK_STR);
102 pub const APPLICATION_PROTOBUF: HeaderValue =
103 HeaderValue::from_static(APPLICATION_PROTOBUF_STR);
104 pub const X_DATADOG_TEST_SESSION_TOKEN: HeaderName =
105 HeaderName::from_static("x-datadog-test-session-token");
106}
107
108#[cfg(all(not(target_arch = "wasm32"), feature = "http-client"))]
109pub type HttpClient = http_common::GenericHttpClient<connector::Connector>;
110#[cfg(all(not(target_arch = "wasm32"), feature = "http-client"))]
111pub type HttpResponse = http_common::HttpResponse;
112#[cfg(feature = "std")]
113pub type HttpRequestBuilder = http::request::Builder;
114#[cfg(all(not(target_arch = "wasm32"), feature = "http-client"))]
115pub trait Connect:
116 hyper_util::client::legacy::connect::Connect + Clone + Send + Sync + 'static
117{
118}
119#[cfg(all(not(target_arch = "wasm32"), feature = "http-client"))]
120impl<C: hyper_util::client::legacy::connect::Connect + Clone + Send + Sync + 'static> Connect
121 for C
122{
123}
124
125#[cfg(feature = "std")]
126pub use {
127 endpoint::{Endpoint, decode_uri_path_in_authority, parse_uri},
128 lock_ext::{MutexExt, RwLockExt},
129};
130
131#[cfg(feature = "alloc")]
133pub use const_format;