1+ //! Serializable record types for the trace format used by CodeTracer.
2+ //!
3+ //! All structures derive [`serde::Serialize`] and [`serde::Deserialize`].
4+
15use std:: cmp:: Ord ;
26use std:: ops;
37use std:: path:: PathBuf ;
@@ -12,6 +16,7 @@ use serde_repr::*;
1216// afterwards in postprocessing
1317// this assumption can change in the future
1418
19+ /// Low level building blocks that make up a recorded trace.
1520#[ derive( Debug , Clone , Serialize , Deserialize ) ]
1621pub enum TraceLowLevelEvent {
1722 Step ( StepRecord ) ,
@@ -321,6 +326,7 @@ impl Into<usize> for TypeId {
321326// use value::Value for interaction with existing frontend
322327// TODO: convert between them or
323328// serialize ValueRecord in a compatible way?
329+ /// Representation of a runtime value captured in a trace.
324330#[ derive( Debug , Clone , Serialize , Deserialize , PartialEq ) ]
325331#[ serde( tag = "kind" ) ]
326332pub enum ValueRecord {
@@ -382,6 +388,7 @@ pub enum ValueRecord {
382388 } ,
383389}
384390
391+ /// Categories of types recorded in the trace.
385392#[ derive( Debug , Default , Copy , Clone , FromPrimitive , Serialize_repr , Deserialize_repr , PartialEq ) ]
386393#[ repr( u8 ) ]
387394pub enum TypeKind {
@@ -440,6 +447,7 @@ pub enum TypeKind {
440447 Slice ,
441448}
442449
450+ /// Kinds of I/O or log events that can appear in a trace.
443451#[ derive( Debug , Default , Copy , Clone , FromPrimitive , Serialize_repr , Deserialize_repr , PartialEq ) ]
444452#[ repr( u8 ) ]
445453pub enum EventLogKind {
0 commit comments