pub struct PduHeader {
pub protocol_version: ProtocolVersion,
pub exercise_id: u8,
pub pdu_type: PduType,
pub protocol_family: ProtocolFamily,
pub timestamp: u32,
pub length: u16,
pub status_record: PduStatusRecord,
}Fields§
§protocol_version: ProtocolVersionThe version of the protocol
exercise_id: u8Exercise ID
pdu_type: PduTypeType of PDU, unique for each PDU class
protocol_family: ProtocolFamilyValue that refers to the protocol family
timestamp: u32Timestamp value
length: u16Length, in bytes, of the PDU
status_record: PduStatusRecordPDU status record
Implementations§
Source§impl PduHeader
impl PduHeader
pub fn new( pdu_type: PduType, protocol_family: ProtocolFamily, exercise_id: u8, length: u16, ) -> Self
pub fn default( pdu_type: PduType, protocol_family: ProtocolFamily, length: u16, ) -> Self
Sourcepub fn calculate_dis_timestamp() -> u32
pub fn calculate_dis_timestamp() -> u32
Gets the current time in terms of IEEE-1278.1 DIS time units
pub fn serialize(&self, buf: &mut BytesMut)
pub fn deserialize(buf: &mut BytesMut) -> PduHeader
pub fn deserialize_pdu_type(data: u8) -> PduType
Trait Implementations§
impl Copy for PduHeader
impl StructuralPartialEq for PduHeader
Auto Trait Implementations§
impl Freeze for PduHeader
impl RefUnwindSafe for PduHeader
impl Send for PduHeader
impl Sync for PduHeader
impl Unpin for PduHeader
impl UnwindSafe for PduHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more