portkey_sdk/
lib.rs

1#![forbid(unsafe_code)]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![doc = include_str!("../README.md")]
4
5// Compile-time check: ensure at least one TLS backend is enabled
6#[cfg(not(any(feature = "rustls-tls", feature = "native-tls")))]
7compile_error!(
8    "At least one TLS backend must be enabled. \
9     Enable either the 'rustls-tls' (recommended) or 'native-tls' feature. \
10     Example: cargo build --features rustls-tls"
11);
12
13mod client;
14mod error;
15pub mod model;
16#[doc(hidden)]
17pub mod prelude;
18pub mod service;
19
20pub use client::{PortkeyClient, PortkeyConfig, builder};
21pub use error::{Error, Result};
22
23/// Tracing target for client-level operations (HTTP requests, client creation).
24#[cfg(feature = "tracing")]
25#[cfg_attr(docsrs, doc(cfg(feature = "tracing")))]
26pub const TRACING_TARGET_CLIENT: &str = "portkey_sdk::client";
27
28/// Tracing target for configuration operations (config creation, validation).
29#[cfg(feature = "tracing")]
30#[cfg_attr(docsrs, doc(cfg(feature = "tracing")))]
31pub const TRACING_TARGET_CONFIG: &str = "portkey_sdk::config";
32
33/// Tracing target for service-level operations (API calls, business logic).
34#[cfg(feature = "tracing")]
35#[cfg_attr(docsrs, doc(cfg(feature = "tracing")))]
36pub const TRACING_TARGET_SERVICE: &str = "portkey_sdk::service";