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 padding: u16,
}
Fields§
§protocol_version: ProtocolVersion
The version of the protocol
exercise_id: u8
Exercise ID
pdu_type: PduType
Type of PDU, unique for each PDU class
protocol_family: ProtocolFamily
Value that refers to the protocol family
timestamp: u32
Timestamp value
length: u16
Length, in bytes, of the PDU
padding: u16
Zero-filled array of padding
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 decode(buf: &mut BytesMut) -> PduHeader
pub fn decode_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