#[repr(u8)]pub enum FrameType {
Data = 0,
HandshakeInit = 1,
HandshakeReply = 2,
HandshakeComplete = 3,
Ping = 4,
Pong = 5,
Close = 6,
FileHeader = 7,
FileChunk = 8,
Ack = 9,
}Expand description
The type of a PO frame, encoded in the lower 4 bits of the first header byte.
Variants§
Data = 0
Application data (chat messages, RPC payloads, etc.)
HandshakeInit = 1
Initiate cryptographic handshake (sends Ed25519 pubkey + X25519 ephemeral).
HandshakeReply = 2
Reply to handshake with responder’s keys.
HandshakeComplete = 3
Confirm handshake — session key is now active.
Ping = 4
Keep-alive ping. Should be sent with CONTROL flag.
Pong = 5
Ping response. Should be sent with CONTROL flag.
Close = 6
Graceful connection close. Should be sent with CONTROL flag.
FileHeader = 7
File transfer metadata (name, size, hash).
FileChunk = 8
File data chunk (sequential binary payload).
Ack = 9
Acknowledgement of a received frame or operation.
Implementations§
Source§impl FrameType
impl FrameType
Sourcepub const fn from_u8(value: u8) -> Result<Self, WireError>
pub const fn from_u8(value: u8) -> Result<Self, WireError>
Try to convert a raw u8 nibble (0x00–0x0F) into a FrameType.
Sourcepub const fn is_handshake(&self) -> bool
pub const fn is_handshake(&self) -> bool
Returns true if this is a handshake-related frame.
Sourcepub const fn is_control(&self) -> bool
pub const fn is_control(&self) -> bool
Returns true if this is a control frame (non-application data).
Sourcepub const fn is_file_transfer(&self) -> bool
pub const fn is_file_transfer(&self) -> bool
Returns true if this carries file transfer data.