[][src]Struct websocket_codec::protocol::FrameHeader

pub struct FrameHeader { /* fields omitted */ }

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]

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]

impl Debug for FrameHeader[src]

impl<'a> Encoder<&'a FrameHeader> for FrameHeaderCodec[src]

type Error = Error

The type of encoding errors. Read more

impl Encoder<FrameHeader> for FrameHeaderCodec[src]

type Error = Error

The type of encoding errors. Read more

impl PartialEq<FrameHeader> for FrameHeader[src]

impl StructuralPartialEq for FrameHeader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,