statime/datastructures/datasets/
path_trace.rs

1use arrayvec::ArrayVec;
2
3use crate::datastructures::{common::ClockIdentity, messages::MAX_DATA_LEN};
4
5/// A concrete implementation of the PTP Path Trace dataset
6/// (IEEE1588-2019 section 16.2.2)
7#[derive(Clone, Debug, Eq, PartialEq)]
8#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9pub struct PathTraceDS {
10    /// See *IEEE1588-2019 section 16.2.2.2.1*.
11    pub list: ArrayVec<ClockIdentity, { MAX_DATA_LEN / 8 }>,
12    /// See *IEEE1588-2019 section 16.2.2.3.1*.
13    pub enable: bool,
14}
15
16impl PathTraceDS {
17    pub(crate) fn new(enable: bool) -> Self {
18        PathTraceDS {
19            list: Default::default(),
20            enable,
21        }
22    }
23}