pub struct FrameInfo {
pub opcode: Opcode,
pub payload_length: PayloadLength,
pub mask: Option<[u8; 4]>,
pub fin: bool,
pub reserved: u8,
}
Expand description
Information about WebSocket frame header.
Fields§
§opcode: Opcode
Type of this WebSocket frame
payload_length: PayloadLength
Length of this frame’s payload. Not to be confused with WebSocket
message length, which is unknown, unless FrameInfo::fin
is set.
mask: Option<[u8; 4]>
Whether this frame uses (or should use, for encoder) masking (and the mask used)
fin: bool
Whether this frame is a final frame and no Opcode::Continuation
should follow
to extend the content of it.
reserved: u8
Should be 0
unless some extensions are used.
Implementations§
Source§impl FrameInfo
impl FrameInfo
Sourcepub const fn is_reasonable(&self) -> bool
pub const fn is_reasonable(&self) -> bool
Indicates that this frame looks like a normal, well-formed frame (not considering WebSocket extensions).
Does not check for valitity of a frame within a sequence of frames,
e.g. for orphaned Opcode::Continuation
frames or
for unfinished prior messages.
Trait Implementations§
impl Copy for FrameInfo
impl Eq for FrameInfo
impl StructuralPartialEq for FrameInfo
Auto Trait Implementations§
impl Freeze for FrameInfo
impl RefUnwindSafe for FrameInfo
impl Send for FrameInfo
impl Sync for FrameInfo
impl Unpin for FrameInfo
impl UnwindSafe for FrameInfo
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