[−][src]Struct websocket_codec::protocol::FrameHeader
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
impl FrameHeader
[src]
pub fn new(
fin: bool,
rsv: u8,
opcode: u8,
mask: Option<Mask>,
data_len: DataLength
) -> Self
[src]
fin: bool,
rsv: u8,
opcode: u8,
mask: Option<Mask>,
data_len: DataLength
) -> Self
Returns a FrameHeader
struct.
pub fn fin(&self) -> bool
[src]
Returns the WebSocket FIN bit, which indicates that this is the last frame in the message.
pub fn rsv(&self) -> u8
[src]
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.
pub fn opcode(&self) -> u8
[src]
Returns the WebSocket opcode, which defines the interpretation of the frame payload data.
pub fn mask(&self) -> Option<Mask>
[src]
Returns the frame's mask.
pub fn data_len(&self) -> DataLength
[src]
Returns the length of the payload data that follows this header.
pub fn header_len(&self) -> usize
[src]
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
impl Clone for FrameHeader
[src]
pub fn clone(&self) -> FrameHeader
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for FrameHeader
[src]
impl<'a> Encoder<&'a FrameHeader> for FrameHeaderCodec
[src]
type Error = Error
The type of encoding errors. Read more
pub fn encode(
&mut self,
item: &'a FrameHeader,
dst: &mut BytesMut
) -> Result<()>
[src]
&mut self,
item: &'a FrameHeader,
dst: &mut BytesMut
) -> Result<()>
impl Encoder<FrameHeader> for FrameHeaderCodec
[src]
type Error = Error
The type of encoding errors. Read more
pub fn encode(&mut self, item: FrameHeader, dst: &mut BytesMut) -> Result<()>
[src]
impl PartialEq<FrameHeader> for FrameHeader
[src]
pub fn eq(&self, other: &FrameHeader) -> bool
[src]
pub fn ne(&self, other: &FrameHeader) -> bool
[src]
impl StructuralPartialEq for FrameHeader
[src]
Auto Trait Implementations
impl RefUnwindSafe for FrameHeader
[src]
impl Send for FrameHeader
[src]
impl Sync for FrameHeader
[src]
impl Unpin for FrameHeader
[src]
impl UnwindSafe for FrameHeader
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,