micromegas_perfetto/
lib.rs

1//! Library to write Perfetto traces, part of Micromegas.
2#![allow(missing_docs, clippy::missing_errors_doc)]
3
4// The library modules below are emptied out only while regenerating the
5// protobuf bindings (the `regen_protos` cfg, set by `build.rs` when the
6// `MICROMEGAS_REGEN_PROTOS` env var is present). This lets the
7// `update-perfetto-protos` binary build and run even when the committed
8// `perfetto.protos.rs` does not compile against the current `prost` runtime.
9// In every normal build — including `--all-features` and `cargo doc` — the
10// cfg is unset, so the full public API is always available.
11
12/// Protobufs (generated code)
13#[allow(
14    clippy::doc_lazy_continuation,
15    clippy::len_without_is_empty,
16    clippy::large_enum_variant,
17    clippy::doc_overindented_list_items
18)]
19#[cfg(not(regen_protos))]
20pub mod protos {
21    include!("perfetto.protos.rs");
22}
23
24/// Async writer trait
25#[cfg(not(regen_protos))]
26pub mod async_writer;
27
28/// Utility functions
29#[cfg(not(regen_protos))]
30pub mod utils;
31
32/// Streaming Trace Writer
33#[cfg(not(regen_protos))]
34pub mod streaming_writer;
35
36/// Chunk sender for streaming traces
37#[cfg(not(regen_protos))]
38pub mod chunk_sender;