pub struct Npdu {
pub expecting_reply: bool,
pub priority: NetworkPriority,
pub destination: Option<NpduAddress>,
pub source: Option<NpduAddress>,
pub hop_count: u8,
pub message_type: Option<NetworkMessageType>,
pub vendor_id: Option<u16>,
pub payload: Bytes,
}Expand description
Decoded Network Protocol Data Unit (Clause 6.2).
A network-layer message is one whose message_type
is set; without it the payload is an APDU.
Fields§
§expecting_reply: boolWhether the sender expects a reply.
priority: NetworkPriorityMessage priority.
destination: Option<NpduAddress>Remote destination address, if routed.
source: Option<NpduAddress>Originating source address (populated by routers).
hop_count: u8Remaining hop count for routed messages (0-255). Only an NPDU with a destination carries one: without it this is 255, and the encoder leaves it out.
message_type: Option<NetworkMessageType>The network-layer message type, or None for an APDU.
vendor_id: Option<u16>Vendor ID for a proprietary network message type
(NetworkMessageType::is_proprietary).
payload: BytesPayload: either APDU bytes or network message data.
Implementations§
Source§impl Npdu
impl Npdu
Sourcepub fn is_network_message(&self) -> bool
pub fn is_network_message(&self) -> bool
Whether it carries a network-layer message rather than an APDU.
Sourcepub fn header_from(view: &Npdu<'_>) -> Self
pub fn header_from(view: &Npdu<'_>) -> Self
An owned copy of view’s control information, with an empty
payload. The payload is the caller’s to attach: the frame the view
was read from, advanced by payload_offset,
shares the frame’s buffer instead of copying it.