1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use std::cell::RefCell;
use self::generator::{ChunkRegistry, Generator};
pub use self::{trace_id::TraceId, validator::TraceIdValidator};
impl TraceId {
pub fn generate() -> Self {
GENERATOR.with(|cell| cell.borrow_mut().generate(&CHUNK_REGISTRY))
}
}
static CHUNK_REGISTRY: ChunkRegistry = ChunkRegistry::new(0);
thread_local! {
static GENERATOR: RefCell<Generator> = RefCell::new(Generator::default());
}
mod generator;
mod trace_id;
mod validator;