1use crate::interface::{layer::Layer, parser::parser_rrc::RRCInfos};
3use core::fmt::Debug;
4
5#[derive(Debug)]
6pub struct Data {
8 pub events: Vec<Trace>,
10 pub current_index: usize,
12}
13
14impl Data {
15 pub fn get_current_trace(&self) -> Option<&Trace> {
17 self.events.get(self.current_index)
18 }
19
20 pub fn is_different_index(&self, index: usize) -> bool {
22 if index == 0 {
23 return true;
24 }
25 self.current_index != index
26 }
27
28 pub fn clear(&mut self) {
30 self.events.clear();
31 self.current_index = 0;
32 }
33}
34
35impl Default for Data {
36 fn default() -> Self {
37 let default_data_size = 2048;
38 Self {
39 events: Vec::with_capacity(default_data_size),
40 current_index: 0,
41 }
42 }
43}
44
45#[derive(Debug, Clone)]
46pub struct Trace {
48 pub timestamp: u64,
51
52 pub layer: Layer,
54
55 pub additional_infos: AdditionalInfos,
57
58 pub hexa: Vec<u8>,
60
61 pub text: Option<Vec<String>>,
63}
64
65#[derive(Debug, Clone)]
67pub enum AdditionalInfos {
68 RRCInfos(RRCInfos),
70}