pub struct PacketFlags(pub u16);std only.Expand description
Packet flags bitfield (16-bit).
Tuple Fields§
§0: u16Implementations§
Source§impl PacketFlags
impl PacketFlags
Sourcepub const UNRELIABLE: u16 = 0x0008
pub const UNRELIABLE: u16 = 0x0008
Fire-and-forget (no retransmission)
Sourcepub const COMPRESSED: u16 = 0x0040
pub const COMPRESSED: u16 = 0x0040
Payload is compressed
Sourcepub const REKEY: u16 = 0x0100
pub const REKEY: u16 = 0x0100
Sender is rekeying — receiver must derive the next AEAD key from the
traffic-secret rekey chain (HKDF-Expand(current, "phantom-rekey-v1", 32),
Invariant 5) before decrypting this packet (Phase 1.5).
Sourcepub const PATH_VALIDATION: u16 = 0x0200
pub const PATH_VALIDATION: u16 = 0x0200
Path-validation challenge / response packet for multi-path migration (Phase 4.2). Payload carries the 32-byte challenge or response.
Sourcepub const COALESCED: u16 = 0x0400
pub const COALESCED: u16 = 0x0400
Payload is a coalesced bundle of inner packets in
[count: u16][len1: u16][payload1]... format (Phase 2.5).
Sourcepub const WINDOW_UPDATE: u16 = 0x0800
pub const WINDOW_UPDATE: u16 = 0x0800
Per-stream flow control update (Phase 4.3). Payload is a
big-endian u32 carrying the receiver’s newly-available
window in bytes (absolute window size, NOT a delta — simpler
and self-correcting under packet loss).
Sourcepub const KEEPALIVE: u16 = 0x1000
pub const KEEPALIVE: u16 = 0x1000
Idle keep-alive PING (Direction #3 — download-only liveness). A small
ENCRYPTED | KEEPALIVE packet with an empty payload that an idle
sender emits to (a) refresh the peer’s inbound-activity timer and (b)
anchor its own liveness timer (the in-flight keep-alive lets a
download-only path — which otherwise sends only ACKs and has nothing in
flight — detect a silently-dead downstream). A bare KEEPALIVE is a
PING; KEEPALIVE | ACK is the peer’s PONG echo. Neither carries
application bytes, so neither reaches recv(). (Spare flag bit — no
header layout / WIRE_VERSION change.)
Sourcepub const PADDED: u16 = 0x2000
pub const PADDED: u16 = 0x2000
Anti-fingerprint size padding present (WIRE v6, deliverable (c)). When set,
the AEAD plaintext ends with a trailer ‹pad_n zero bytes› ‖ pad_n:u16be
that the receiver strips after decrypt (see crate::transport::shaping).
The flag rides inside the HP-masked header, so it is invisible on the wire;
the padding itself is encrypted + authenticated, so only the bucketed
datagram size is observable. (Spare flag bit — no header layout change.)
Sourcepub const COVER: u16 = 0x4000
pub const COVER: u16 = 0x4000
Anti-fingerprint cover (dummy) traffic (WIRE v6, deliverable (e)). An
ENCRYPTED | COVER packet carries no application data (empty inner
plaintext, typically PADDED to a bucket); its sole purpose is to normalize
the outbound traffic pattern (idle-fill + a floor packet rate) so silence and
volume no longer leak. It AEAD-authenticates like any packet (so it refreshes
the peer’s liveness and cannot be off-path injected); the receiver drops it
before the data path, so it never reaches recv(). (Spare flag bit — no
header layout / WIRE_VERSION change.)
Sourcepub const fn is_reliable(&self) -> bool
pub const fn is_reliable(&self) -> bool
Check if reliable delivery is required
Sourcepub const fn is_control(&self) -> bool
pub const fn is_control(&self) -> bool
Check if this is a control packet
Trait Implementations§
Source§impl Clone for PacketFlags
impl Clone for PacketFlags
Source§fn clone(&self) -> PacketFlags
fn clone(&self) -> PacketFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PacketFlags
Source§impl Debug for PacketFlags
impl Debug for PacketFlags
Source§impl Default for PacketFlags
impl Default for PacketFlags
Source§fn default() -> PacketFlags
fn default() -> PacketFlags
impl Eq for PacketFlags
Source§impl PartialEq for PacketFlags
impl PartialEq for PacketFlags
Source§fn eq(&self, other: &PacketFlags) -> bool
fn eq(&self, other: &PacketFlags) -> bool
self and other values to be equal, and is used by ==.