BCNP 3.2.1
Batched Command Network Protocol
Loading...
Searching...
No Matches
bcnp::DecodeViewResult Struct Reference

Result of decoding a packet from raw bytes. More...

#include <packet.h>

Public Attributes

std::optional< PacketViewview
 Decoded view (valid if error == None)
 
PacketError error {PacketError::None}
 Error code if decode failed.
 
std::size_t bytesConsumed {0}
 Bytes consumed from input buffer.
 

Detailed Description

Result of decoding a packet from raw bytes.

Contains either a valid PacketView or an error code. Always check error before accessing view. The bytesConsumed field indicates how many bytes were processed (useful for stream parsing).

Definition at line 289 of file packet.h.

Member Data Documentation

◆ bytesConsumed

std::size_t bcnp::DecodeViewResult::bytesConsumed {0}

Bytes consumed from input buffer.

Definition at line 292 of file packet.h.

◆ error

PacketError bcnp::DecodeViewResult::error {PacketError::None}

Error code if decode failed.

Definition at line 291 of file packet.h.

◆ view

std::optional<PacketView> bcnp::DecodeViewResult::view

Decoded view (valid if error == None)

Definition at line 290 of file packet.h.


The documentation for this struct was generated from the following file: