ray/payload/
types.rs

1use serde::Serialize;
2
3/// Payload for logging arbitrary JSON values.
4#[derive(Debug, Clone, Serialize)]
5pub struct LogContent {
6    pub values: Vec<serde_json::Value>,
7}
8
9/// Payload for custom HTML content with a label.
10#[derive(Debug, Clone, Serialize)]
11pub struct CustomContent {
12    pub content: String,
13    pub label: String,
14}
15
16/// Payload for creating a new screen in Ray.
17#[derive(Debug, Clone, Serialize)]
18pub struct NewScreenContent {
19    pub name: String,
20}
21
22/// Payload for setting the color of a Ray entry.
23#[derive(Debug, Clone, Serialize)]
24pub struct ColorContent {
25    pub color: String,
26}
27
28/// Payload for setting the size of a Ray entry.
29#[derive(Debug, Clone, Serialize)]
30pub struct SizeContent {
31    pub size: String,
32}
33
34/// Payload for labeling a Ray entry.
35#[derive(Debug, Clone, Serialize)]
36pub struct LabelContent {
37    pub label: String,
38}
39
40/// Single frame entry for trace payloads.
41#[derive(Debug, Clone, Serialize)]
42pub struct TraceFrame {
43    pub file_name: String,
44    pub line_number: u32,
45    pub class: String,
46    pub method: String,
47    pub vendor_frame: bool,
48}
49
50/// Payload for trace frames.
51#[derive(Debug, Clone, Serialize)]
52pub struct TraceContent {
53    pub frames: Vec<TraceFrame>,
54}
55
56/// Payload for the caller frame.
57#[derive(Debug, Clone, Serialize)]
58pub struct CallerContent {
59    pub frame: TraceFrame,
60}
61
62/// Payload for measure timers.
63#[derive(Debug, Clone, Serialize)]
64pub struct MeasureContent {
65    pub name: String,
66    pub is_new_timer: bool,
67    pub total_time: u64,
68    pub max_memory_usage_during_total_time: u64,
69    pub time_since_last_call: u64,
70    pub max_memory_usage_since_last_call: u64,
71}
72
73/// Payload for carbon-like timestamps.
74#[derive(Debug, Clone, Serialize)]
75pub struct CarbonContent {
76    pub formatted: String,
77    pub timestamp: i64,
78    pub timezone: String,
79}