Skip to main content

Header

Struct Header 

Source
pub struct Header {
Show 19 fields pub sdo_id: SdoId, pub version: PtpVersion, pub domain_number: u8, pub alternate_master_flag: bool, pub two_step_flag: bool, pub unicast_flag: bool, pub ptp_profile_specific_1: bool, pub ptp_profile_specific_2: bool, pub leap61: bool, pub leap59: bool, pub current_utc_offset_valid: bool, pub ptp_timescale: bool, pub time_tracable: bool, pub frequency_tracable: bool, pub synchronization_uncertain: bool, pub correction_field: TimeInterval, pub source_port_identity: PortIdentity, pub sequence_id: u16, pub log_message_interval: i8,
}
Expand description

The header of a PTP version 2 message.

For more details, see IEEE1588-2019 section 13.3.

Fields§

§sdo_id: SdoId

Sdo ID of the profile in use for the message.

§version: PtpVersion

Specific version of PTP for this message.

§domain_number: u8

The domain number of the message.

This is used to allow multiple PTP setups to run within the same network without interfering with each other.

§alternate_master_flag: bool

Indicates whether the sender is an alternate master.

This is used with the Grandmaster Cluster and Alternate Master optional PTP features. For more details, see IEEE1588-2019 sections 17.2 and17.3

§two_step_flag: bool

Indicates whether the message is part of a two-step time transmission.

§unicast_flag: bool

Indicates whether the message is sent via a unicast connection.

§ptp_profile_specific_1: bool

Used for PTP profile-specific information.

§ptp_profile_specific_2: bool

Used for PTP profile-specific information.

§leap61: bool

In announce messages, indicates whether the last minute of the current UTC day shall have 61 seconds.

§leap59: bool

In announce messages, indicates whether the last minute of the current UTC day shall have 59 seconds.

§current_utc_offset_valid: bool

In announce messages, indicates whether the offset between UTC and TAI is valid.

§ptp_timescale: bool

In announce messages, indicates whether the timescale is TAI (when true), or something else.

§time_tracable: bool

In announce messages, indicates whether the time provided is traceable in the metrology sense.

§frequency_tracable: bool

In announce messages, indicates whether the frequency provided is traceable in the metrology sense.

§synchronization_uncertain: bool

In announce messages, a true value indicates that the time provider may not itself be properly synchronized.

§correction_field: TimeInterval

Correction field to the timestamps in event messages.

This is used to improve the precision of those timestamps, as well as to allow for compensating for the dwell time of messages in switches.

§source_port_identity: PortIdentity

Identity of the PTP port that sent this message.

§sequence_id: u16

Rolling sequence id for the message.

§log_message_interval: i8

Used for communication of message sending intervals for some messages

See IEEE1588 Table 42 in section 13.3.2.14 for more details.

Implementations§

Source§

impl Header

Source

pub fn new(minor_ptp_version: u8) -> Self

Get a new header initialized with default values for all of the fields.

Trait Implementations§

Source§

impl Clone for Header

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Header

Source§

impl Debug for Header

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Header

Source§

impl PartialEq for Header

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Header

Auto Trait Implementations§

§

impl Forget for Header

§

impl Freeze for Header

§

impl Move for Header

§

impl RefUnwindSafe for Header

§

impl Send for Header

§

impl Sync for Header

§

impl Unpin for Header

§

impl UnsafeUnpin for Header

§

impl UnwindSafe for Header

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.