Skip to main content

dial9_core/
lib.rs

1//! dial9 recording core: the event bus, recorder, and trace writer.
2
3#![warn(unreachable_pub)]
4
5/// Declares an item `pub` under the `test-util` feature and `pub(crate)`
6/// otherwise. Lets sibling-crate tests reach internals (batches, the collector,
7/// raw encode/drain helpers) without putting them on the production public API.
8macro_rules! test_util_pub {
9    ($(#[$attr:meta])* $kw:ident $name:ident $($rest:tt)*) => {
10        #[cfg(feature = "test-util")]
11        $(#[$attr])* pub $kw $name $($rest)*
12        // Without the feature these are crate-internal and only the test-util
13        // consumers reference them, so dead-code analysis would flag them.
14        #[cfg(not(feature = "test-util"))]
15        $(#[$attr])* #[allow(dead_code)] pub(crate) $kw $name $($rest)*
16    };
17}
18pub(crate) use test_util_pub;
19
20/// Shared boot identifier (`{4-alpha}-{pid}`) for segment namespacing + S3 keys.
21#[doc(hidden)]
22pub mod boot_id;
23/// Rotating trace-segment buffers: the on-disk and in-memory sinks.
24pub mod buffer;
25/// Monotonic/realtime clock readings, the trace time base.
26pub mod clock;
27/// Central ring buffer of encoded event batches awaiting write.
28pub mod collector;
29/// User-provided custom events.
30pub mod custom_events;
31/// On-demand pipeline runs: trigger, request channel, and dump receipts.
32#[cfg(feature = "pipeline")]
33pub mod dump;
34/// Thread-local event encoding buffers and the `Encodable` trait.
35pub mod encoder;
36/// Flush-thread loop. Driven by `Recorder`; not public API.
37pub(crate) mod flush_loop;
38/// Wire-format events emitted by the bus itself.
39pub mod format;
40/// Writer↔worker filesystem/channel abstraction for trace segments.
41pub(crate) mod fs;
42/// Cloneable handle for recording events and controlling telemetry.
43pub mod handle;
44/// Operational metrics for the core flush path.
45pub(crate) mod metrics;
46/// Segment payload buffer. `Payload` is part of the public API via [`pipeline`].
47#[cfg(feature = "pipeline")]
48pub(crate) mod payload;
49/// `SegmentProcessor` trait and the data threaded through the pipeline.
50#[cfg(feature = "pipeline")]
51pub mod pipeline;
52/// Cfg-gated concurrency primitives (std / shuttle).
53///
54/// `pub` so sibling crates share one shuttle shim, but not part of the public
55/// API.
56#[doc(hidden)]
57pub mod primitives;
58/// Per-call-site rate limiting for log lines.
59#[doc(hidden)]
60pub mod rate_limit;
61/// The recorder builder.
62pub mod recorder;
63/// The live recorder: recording state with RAII shutdown.
64pub mod recording;
65/// Geometric/Poisson sampling primitives (RNG, exponential draws).
66#[doc(hidden)]
67pub mod sampling;
68/// Sealed-segment detection. The segment types are public via [`pipeline`].
69pub(crate) mod sealed;
70/// Runtime-agnostic recording state shared across threads.
71#[doc(hidden)]
72pub mod shared_state;
73/// `Source` trait: pluggable flush-thread data sources.
74pub mod source;
75/// Test-only record/drain/write helpers.
76#[cfg(feature = "test-util")]
77pub mod test_util;
78/// Thread identity helpers.
79pub mod thread;
80/// Segment-processing worker: runs a `SegmentProcessor` pipeline over sealed segments.
81#[cfg(feature = "pipeline")]
82pub mod worker;
83
84#[cfg(all(test, shuttle))]
85mod pipeline_shuttle_tests;