pub struct ParserFrameHeader { /* private fields */ }Expand description
Validated fixed parser frame header.
Implementations§
Source§impl ParserFrameHeader
impl ParserFrameHeader
Sourcepub fn new(
kind: ParserFrameKind,
payload_len: u32,
) -> Result<Self, ParserProtocolError>
pub fn new( kind: ParserFrameKind, payload_len: u32, ) -> Result<Self, ParserProtocolError>
Construct and bound a fixed frame header before payload allocation.
§Errors
Returns an error when payload_len exceeds the selected kind’s ceiling.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, ParserProtocolError>
pub fn decode(bytes: &[u8]) -> Result<Self, ParserProtocolError>
Decode and validate the fixed header before inspecting or allocating its payload.
§Errors
Returns an error for short input, an invalid marker, unsupported version, unknown kind, or a kind-specific declared-length overflow.
Sourcepub const fn kind(self) -> ParserFrameKind
pub const fn kind(self) -> ParserFrameKind
Return the closed payload kind.
Sourcepub const fn payload_len(self) -> u32
pub const fn payload_len(self) -> u32
Return the validated declared payload length.
Trait Implementations§
Source§impl Clone for ParserFrameHeader
impl Clone for ParserFrameHeader
Source§fn clone(&self) -> ParserFrameHeader
fn clone(&self) -> ParserFrameHeader
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 ParserFrameHeader
impl Debug for ParserFrameHeader
Source§impl PartialEq for ParserFrameHeader
impl PartialEq for ParserFrameHeader
impl Copy for ParserFrameHeader
impl Eq for ParserFrameHeader
impl StructuralPartialEq for ParserFrameHeader
Auto Trait Implementations§
impl Freeze for ParserFrameHeader
impl RefUnwindSafe for ParserFrameHeader
impl Send for ParserFrameHeader
impl Sync for ParserFrameHeader
impl Unpin for ParserFrameHeader
impl UnwindSafe for ParserFrameHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.