pub mod codec;
#[cfg(feature = "serde-deserialize")]
pub mod de;
pub mod decoder;
pub mod encoder;
pub(crate) mod leb128;
pub mod schema;
pub mod types;
#[cfg(feature = "serde-deserialize")]
pub use de::DeserError;
pub use dial9_trace_format_derive::TraceEvent;
pub use types::DynamicListRef;
pub use types::DynamicMapRef;
pub use types::EventEncoder;
pub use types::FieldValue;
pub use types::InternedStackFrames;
pub use types::InternedString;
pub use types::StackFrames;
pub use types::TraceField;
use schema::{FieldDef, SchemaEntry};
pub const STATIC_WIRE_ID_LIMIT: u16 = 256;
#[doc(hidden)]
pub static __NEXT_TYPE_SLOT: std::sync::atomic::AtomicU16 = std::sync::atomic::AtomicU16::new(1);
pub trait TraceEvent {
fn type_slot() -> u16 {
0
}
fn event_name() -> &'static str;
fn field_defs() -> Vec<FieldDef>;
fn has_timestamp() -> bool {
true
}
fn timestamp(&self) -> u64;
fn encode_fields<W: std::io::Write>(
&self,
enc: &mut types::EventEncoder<'_, W>,
) -> std::io::Result<()>;
fn schema_entry() -> SchemaEntry {
SchemaEntry {
name: Self::event_name().to_string(),
has_timestamp: Self::has_timestamp(),
fields: Self::field_defs(),
annotations: Vec::new(),
}
}
}