use crate::{
config::{ClockIdentity, ClockQuality},
datastructures::{common::PortIdentity, datasets::InternalParentDS},
};
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ParentDS {
pub parent_port_identity: PortIdentity,
pub grandmaster_identity: ClockIdentity,
pub grandmaster_clock_quality: ClockQuality,
pub grandmaster_priority_1: u8,
pub grandmaster_priority_2: u8,
}
impl From<&InternalParentDS> for ParentDS {
fn from(v: &InternalParentDS) -> Self {
Self {
parent_port_identity: v.parent_port_identity,
grandmaster_identity: v.grandmaster_identity,
grandmaster_clock_quality: v.grandmaster_clock_quality,
grandmaster_priority_1: v.grandmaster_priority_1,
grandmaster_priority_2: v.grandmaster_priority_2,
}
}
}