open_dis_rust/common/
generic_header.rs1use bytes::{Buf, BytesMut};
8
9use crate::common::enums::{PduType, ProtocolFamily};
10
11pub trait GenericHeader: Sized {
12 fn pdu_type(&self) -> PduType;
13 fn set_pdu_type(&mut self, value: PduType);
14
15 fn protocol_family(&self) -> ProtocolFamily;
16 fn set_protocol_family(&mut self, value: ProtocolFamily);
17
18 fn length(&self) -> u16;
19 fn set_length(&mut self, value: u16);
20
21 fn serialize(&self, buf: &mut BytesMut);
22 fn deserialize<B: Buf>(bug: &mut B) -> Self;
23}