pub fn new() -> Self {
        let mut rng = rand::thread_rng();

        Self {
            id: rng.gen(),
            version: 0,
            trace_id: rng.gen(),
            parent_id: None,
            flags: 1,
        }
    }
/// Generate a new TraceContext object without a parent.
///
/// By default root TraceContext objects are sampled.
/// To mark it unsampled, call `context.set_sampled(false)`.
///
/// # Examples
/// ```
/// use http_types::trace::TraceContext;
///
/// let context = TraceContext::new();
///
/// assert_eq!(context.parent_id(), None);
/// assert_eq!(context.sampled(), true);
/// ```
Generate a new TraceContext object without a parent.
By default root TraceContext objects are sampled.
Generate a new TraceContext object without a parent . By default root TraceContext objects are sampled .
pub fn new() -> Self {
        let mut rng = rand::thread_rng();
        Self {
            id: rng.gen(),
            version: 0,
            trace_id: rng.gen(),
            parent_id: None,
            flags: 1,
        }
    }
pub fn new ( ) -> Self { let mut rng = rand :: thread_rng ( ) ; Self { id : rng . gen ( ) , version : 0 , trace_id : rng . gen ( ) , parent_id : None , flags : 1 , } }
Generate a new TraceContext object without a parent.
Generate a new TraceContext object without a parent .
examples
```
use http_types::trace::TraceContext.

let context = TraceContext::new().

assert_eq!(context.parent_id(), None);
assert_eq!(context.sampled(), true);
```
` ` ` use http_types :: trace :: TraceContext . let context = TraceContext :: new () . assert_eq! ( context . parent_id () None ) ; assert_eq! ( context . sampled () true ) ; ` ` `