Struct dis_rust::common::pdu_header_record::PDUHeaderRecord
source · [−]pub struct PDUHeaderRecord {
pub protocol_version: u8,
pub exercise_id: u8,
pub pdu_type: u8,
pub protocol_family: u8,
pub timestamp: u32,
pub length: u16,
pub padding: u16,
}
Expand description
PDU Header Record as defined in IEEE 1278.1 standard. Used to communicate PDU information during the simulation.
Fields
protocol_version: u8
exercise_id: u8
pdu_type: u8
protocol_family: u8
timestamp: u32
length: u16
padding: u16
Implementations
sourceimpl PDUHeaderRecord
impl PDUHeaderRecord
sourcepub fn new(
pdu_type: PDUType,
protocol_family: ProtocolFamily,
exercise_id: u8,
length: u16
) -> Self
pub fn new(
pdu_type: PDUType,
protocol_family: ProtocolFamily,
exercise_id: u8,
length: u16
) -> Self
Provides a function to create a new PDUHeaderRecord. Timestamps are automatically generated using the current system time.
sourcepub fn default(
pdu_type: PDUType,
protocol_family: ProtocolFamily,
length: u16
) -> Self
pub fn default(
pdu_type: PDUType,
protocol_family: ProtocolFamily,
length: u16
) -> Self
Provides a function to create a default PDUHeaderRecord. The header uses exercise ID 1. Timestamps are automatically generated using the current system time.
Trait Implementations
sourceimpl Clone for PDUHeaderRecord
impl Clone for PDUHeaderRecord
sourcefn clone(&self) -> PDUHeaderRecord
fn clone(&self) -> PDUHeaderRecord
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PDUHeaderRecord
impl Debug for PDUHeaderRecord
sourceimpl PartialEq<PDUHeaderRecord> for PDUHeaderRecord
impl PartialEq<PDUHeaderRecord> for PDUHeaderRecord
sourcefn eq(&self, other: &PDUHeaderRecord) -> bool
fn eq(&self, other: &PDUHeaderRecord) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &PDUHeaderRecord) -> bool
fn ne(&self, other: &PDUHeaderRecord) -> bool
This method tests for !=
.
impl Copy for PDUHeaderRecord
impl StructuralPartialEq for PDUHeaderRecord
Auto Trait Implementations
impl RefUnwindSafe for PDUHeaderRecord
impl Send for PDUHeaderRecord
impl Sync for PDUHeaderRecord
impl Unpin for PDUHeaderRecord
impl UnwindSafe for PDUHeaderRecord
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more