pub struct FrameHeader {
pub frame_type: FrameType,
pub flags: FrameFlags,
pub channel_id: u32,
pub stream_id: u64,
pub payload_len: u64,
}Expand description
A decoded PO frame header.
This is a pure value type — it does not own or reference the payload.
After decoding the header, read payload_len bytes from the transport
to get the payload.
Fields§
§frame_type: FrameTypeThe type of this frame (Data, Handshake, Ping, etc.).
flags: FrameFlagsProcessing flags (control, priority, encrypted).
channel_id: u32Logical channel for application-level multiplexing.
stream_id: u64Stream identifier for QUIC-like concurrent streams within a channel.
payload_len: u64Length of the payload that follows this header.
Implementations§
Source§impl FrameHeader
impl FrameHeader
Sourcepub const fn data(channel_id: u32, payload_len: u64) -> Self
pub const fn data(channel_id: u32, payload_len: u64) -> Self
Create a new header for a data frame with default flags.
Sourcepub const fn control(frame_type: FrameType) -> Self
pub const fn control(frame_type: FrameType) -> Self
Create a new control frame header (e.g., Ping, Pong, Close).
Sourcepub const fn with_encrypted(self) -> Self
pub const fn with_encrypted(self) -> Self
Set the encrypted flag on this header.
Sourcepub const fn with_priority(self) -> Self
pub const fn with_priority(self) -> Self
Set the priority flag on this header.
Sourcepub const fn with_stream(self, stream_id: u64) -> Self
pub const fn with_stream(self, stream_id: u64) -> Self
Set the stream ID.
Sourcepub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Calculate the exact number of bytes this header will occupy when encoded.
Trait Implementations§
Source§impl Clone for FrameHeader
impl Clone for FrameHeader
Source§fn clone(&self) -> FrameHeader
fn clone(&self) -> FrameHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FrameHeader
impl Debug for FrameHeader
Source§impl Display for FrameHeader
impl Display for FrameHeader
Source§impl PartialEq for FrameHeader
impl PartialEq for FrameHeader
impl Copy for FrameHeader
impl Eq for FrameHeader
impl StructuralPartialEq for FrameHeader
Auto Trait Implementations§
impl Freeze for FrameHeader
impl RefUnwindSafe for FrameHeader
impl Send for FrameHeader
impl Sync for FrameHeader
impl Unpin for FrameHeader
impl UnsafeUnpin for FrameHeader
impl UnwindSafe for FrameHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more