Struct tungstenite::protocol::frame::FrameHeader
source · pub struct FrameHeader {
pub is_final: bool,
pub rsv1: bool,
pub rsv2: bool,
pub rsv3: bool,
pub opcode: OpCode,
pub mask: Option<[u8; 4]>,
}
Expand description
A struct representing a WebSocket frame header.
Fields§
§is_final: bool
Indicates that the frame is the last one of a possibly fragmented message.
rsv1: bool
Reserved for protocol extensions.
rsv2: bool
Reserved for protocol extensions.
rsv3: bool
Reserved for protocol extensions.
opcode: OpCode
WebSocket protocol opcode.
mask: Option<[u8; 4]>
A frame mask, if any.
Implementations§
source§impl FrameHeader
impl FrameHeader
sourcepub fn parse(
cursor: &mut Cursor<impl AsRef<[u8]>>,
) -> Result<Option<(Self, u64)>>
pub fn parse( cursor: &mut Cursor<impl AsRef<[u8]>>, ) -> Result<Option<(Self, u64)>>
Parse a header from an input stream.
Returns None
if insufficient data and does not consume anything in this case.
Payload size is returned along with the header.
Trait Implementations§
source§impl Clone for FrameHeader
impl Clone for FrameHeader
source§fn clone(&self) -> FrameHeader
fn clone(&self) -> FrameHeader
Returns a copy 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 Default for FrameHeader
impl Default for FrameHeader
source§impl PartialEq for FrameHeader
impl PartialEq 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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)