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
//! Utilities for converting borrowed data to owned data.
//!
//! This module provides traits and implementations for converting types with lifetime
//! parameters to equivalent types with `'static` lifetime.
//! This is essential for storing telemetry data in contexts that require owned data, such as when sending
//! data across thread boundaries or storing it in global collectors.
//!
//! # Core Trait
//!
//! The [`ToStatic`] trait provides a standardized way to convert borrowed data to
//! owned data while preserving the original structure and semantics.
//!
//! # Usage
//!
//! This is primarily used internally by the telemetry system to ensure that
//! telemetry data can be safely stored and transmitted regardless of the original
//! lifetime constraints of the input data.
use Cow;
/// A trait for converting types with lifetime parameters to equivalent types with 'static lifetime.