Struct websocket_codec::protocol::FrameHeader
source · [−]pub struct FrameHeader { /* private fields */ }
Expand description
Describes an individual frame within a WebSocket message at a low level.
The frame header is a lower level detail of the WebSocket protocol. At the application level,
use Message
structs and the MessageCodec
.
Implementations
sourceimpl FrameHeader
impl FrameHeader
sourcepub fn new(
fin: bool,
rsv: u8,
opcode: u8,
mask: Option<Mask>,
data_len: DataLength
) -> Self
pub fn new(
fin: bool,
rsv: u8,
opcode: u8,
mask: Option<Mask>,
data_len: DataLength
) -> Self
Returns a FrameHeader
struct.
sourcepub fn fin(&self) -> bool
pub fn fin(&self) -> bool
Returns the WebSocket FIN bit, which indicates that this is the last frame in the message.
sourcepub fn rsv(&self) -> u8
pub fn rsv(&self) -> u8
Returns the WebSocket RSV1, RSV2 and RSV3 bits.
The RSV bits may be used by extensions to the WebSocket protocol not exposed by this crate.
sourcepub fn opcode(&self) -> u8
pub fn opcode(&self) -> u8
Returns the WebSocket opcode, which defines the interpretation of the frame payload data.
sourcepub fn data_len(&self) -> DataLength
pub fn data_len(&self) -> DataLength
Returns the length of the payload data that follows this header.
sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the total length of the frame header.
The frame header is between 2 bytes and 10 bytes in length, depending on the presence of a mask and the length of the payload data.
Trait Implementations
sourceimpl Clone for FrameHeader
impl Clone for FrameHeader
sourcefn clone(&self) -> FrameHeader
fn clone(&self) -> FrameHeader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FrameHeader
impl Debug for FrameHeader
sourceimpl<'a> Encoder<&'a FrameHeader> for FrameHeaderCodec
impl<'a> Encoder<&'a FrameHeader> for FrameHeaderCodec
sourceimpl Encoder<FrameHeader> for FrameHeaderCodec
impl Encoder<FrameHeader> for FrameHeaderCodec
sourceimpl PartialEq<FrameHeader> for FrameHeader
impl PartialEq<FrameHeader> for FrameHeader
sourcefn eq(&self, other: &FrameHeader) -> bool
fn eq(&self, other: &FrameHeader) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &FrameHeader) -> bool
fn ne(&self, other: &FrameHeader) -> bool
This method tests for !=
.
impl StructuralPartialEq for FrameHeader
Auto Trait Implementations
impl RefUnwindSafe for FrameHeader
impl Send for FrameHeader
impl Sync for FrameHeader
impl Unpin for FrameHeader
impl UnwindSafe for FrameHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more